+ Reply to Thread
Results 1 to 7 of 7

Disable Insert Sheet function - NOT Working

  1. #1
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Disable Insert Sheet function - NOT Working

    Hello - Disable Insert Sheet function - NOT Working... is this the correct code?

    Please Login or Register  to view this content.

    John

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Disable Insert Sheet function - NOT Working

    Hi, John,

    if you placed the code in ThisWorkbook code should work as you expect - if you use 2007 or later you would need to find different commands as CommandBars("Ply") will not create an error but commandbar should not be visible as this commandbar turned into ribbon control. For that purpose maybe have a look at How to disable Right Click Delete Sheet Command in Excel 2010 using VBA.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Disable Insert Sheet function - NOT Working

    The first question is the code above written correctly and second - I am using Excel 2013 - will this work for that version?

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Disable Insert Sheet function - NOT Working

    Hi, John,

    except for the last code line the code worked for me with Excel2013 and Win8.1 in the named place, and I think I explained why the last line would not work as well.

    Ciao,
    Holger

  5. #5
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Disable Insert Sheet function - NOT Working

    I really thank you for the feedback... I placed this code minus the line of code you mention and it does not work - I placed the code in the sheet1 of the workbook - is that correct?

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Disable Insert Sheet function - NOT Working

    Hi, John,

    it would really help if you read carefully what I wrote: ThisWorkbook. Event will only get fired there as an event behind an existing sheet won´t get fired when you add a new sheet (unless you use a template and copy that, and I would definitely use a different command for that - the event used is part of the Workbook and not any Worksheet).

    Ciao,
    Holger
    Last edited by HaHoBe; 11-03-2014 at 12:54 AM.

  7. #7
    Forum Contributor
    Join Date
    09-10-2008
    Location
    Phoenix, AZ
    MS-Off Ver
    Office 365
    Posts
    985

    Re: Disable Insert Sheet function - NOT Working

    HaHoBe,

    I want again to thank you for your Guidance... The old saying step away and relook at it is what I did... Went online and looked at ThisWorkbook and realized that it was right in front of me the whole time in the Explorer pane - really sorry to frustrate you...

    It works perfect as you indicted - again thanks and sorry to frustrate!

    John

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. error on disable/insert row disable code
    By nickmax1 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-09-2014, 05:15 AM
  2. Disable Insert and Delete Row Function on Ribbon
    By oracle259 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-04-2014, 01:50 PM
  3. Enable/disable copy paste (disable part not working)
    By timtim89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2012, 07:23 PM
  4. [SOLVED] Insert Name Function not working
    By genius in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-01-2006, 11:05 PM
  5. [SOLVED] Disable Insert Column without protecting sheet.
    By Steven in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-05-2006, 01:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1