close

I have a spreadsheet where I don't want users to be able to delete a
worksheet. How do I code it so that the quot;Delete...quot; on the shortcut
menu for the worksheet tabs is disabled? I'm thinking that part of the
code is:

.Controls(quot;Delete...quot;).enabled=Falsebut can't figure out the rest.

Thanks for any help!--
Mary Kathryn
------------------------------------------------------------------------
Mary Kathryn's Profile: www.excelforum.com/member.php...oamp;userid=31905
View this thread: www.excelforum.com/showthread...hreadid=518725Use this

Application.CommandBars(quot;Plyquot;).FindControl(ID:=847 ).Enabled = False

See also
www.rondebruin.com/menuid.htm

--
Regards Ron de Bruin
www.rondebruin.nlquot;Mary Kathrynquot; gt; wrote in message
news:Mary.Kathryn.243n6m_1141398604.0775@excelforu m-nospam.com...
gt;
gt; I have a spreadsheet where I don't want users to be able to delete a
gt; worksheet. How do I code it so that the quot;Delete...quot; on the shortcut
gt; menu for the worksheet tabs is disabled? I'm thinking that part of the
gt; code is:
gt;
gt; Controls(quot;Delete...quot;).enabled=False
gt;
gt;
gt; but can't figure out the rest.
gt;
gt; Thanks for any help!
gt;
gt;
gt; --
gt; Mary Kathryn
gt; ------------------------------------------------------------------------
gt; Mary Kathryn's Profile: www.excelforum.com/member.php...oamp;userid=31905
gt; View this thread: www.excelforum.com/showthread...hreadid=518725
gt;

That did the trick! I sure do appreciate your help!--
Mary Kathryn
------------------------------------------------------------------------
Mary Kathryn's Profile: www.excelforum.com/member.php...oamp;userid=31905
View this thread: www.excelforum.com/showthread...hreadid=518725There's an option to delete sheets under Edit (on the worksheet menubar).

And the user can just drag that tab to another workbook.

Just a warning that there are other ways to delete sheets.

You may want to consider using Tools|Protection|protect workbook and check that
Structure option. The user won't be able to move/delete/insert/rename/copy any
of those worksheets.

Mary Kathryn wrote:
gt;
gt; I have a spreadsheet where I don't want users to be able to delete a
gt; worksheet. How do I code it so that the quot;Delete...quot; on the shortcut
gt; menu for the worksheet tabs is disabled? I'm thinking that part of the
gt; code is:
gt;
gt; Controls(quot;Delete...quot;).enabled=False
gt;
gt; but can't figure out the rest.
gt;
gt; Thanks for any help!
gt;
gt; --
gt; Mary Kathryn
gt; ------------------------------------------------------------------------
gt; Mary Kathryn's Profile: www.excelforum.com/member.php...oamp;userid=31905
gt; View this thread: www.excelforum.com/showthread...hreadid=518725

--

Dave Peterson

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()