+ Reply to Thread
Results 1 to 5 of 5

VB code changed Excel settings for all worksheets

  1. #1
    JenniferMc
    Guest

    VB code changed Excel settings for all worksheets

    I used the following vb code in a file to disable a the menu items. Now
    every time I open Excel the Menu is not there.
    Green around the gills with vb. What did I do wrong?

    Application.CommandBars.("Worksheet Menu Bar").Enabled = False

  2. #2
    Ron de Bruin
    Guest

    Re: VB code changed Excel settings for all worksheets

    Hi JenniferMc

    Open Excel
    Alt-F11
    Insert module
    Paste the sub
    Alt-Q

    Alt-F8
    Select test
    Run

    Sub test()
    Application.CommandBars("Worksheet Menu Bar").Enabled = True
    End Sub



    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "JenniferMc" <[email protected]> wrote in message news:[email protected]...
    >I used the following vb code in a file to disable a the menu items. Now
    > every time I open Excel the Menu is not there.
    > Green around the gills with vb. What did I do wrong?
    >
    > Application.CommandBars.("Worksheet Menu Bar").Enabled = False




  3. #3
    Paul
    Guest

    RE: VB code changed Excel settings for all worksheets



    "JenniferMc" wrote:

    > I used the following vb code in a file to disable a the menu items. Now
    > every time I open Excel the Menu is not there.
    > Green around the gills with vb. What did I do wrong?
    >
    > Application.CommandBars.("Worksheet Menu Bar").Enabled = False


    I learned the hard way that those code lines become the ongoing defaults for
    Excel. I cured it by running a macro wherein the codes end in "=True". The
    problem is that any users that you gave your macros to now have the same
    problem of a missing menu. You'll have to send them the repair macro.

    Regards
    Paul



  4. #4
    JenniferMc
    Guest

    Re: VB code changed Excel settings for all worksheets

    Can this code run when the document is closed so that only the specific
    workbook is impacted?

    "Ron de Bruin" wrote:

    > Hi JenniferMc
    >
    > Open Excel
    > Alt-F11
    > Insert module
    > Paste the sub
    > Alt-Q
    >
    > Alt-F8
    > Select test
    > Run
    >
    > Sub test()
    > Application.CommandBars("Worksheet Menu Bar").Enabled = True
    > End Sub
    >
    >
    >
    > --
    > Regards Ron de Bruin
    > http://www.rondebruin.nl
    >
    >
    >
    > "JenniferMc" <[email protected]> wrote in message news:[email protected]...
    > >I used the following vb code in a file to disable a the menu items. Now
    > > every time I open Excel the Menu is not there.
    > > Green around the gills with vb. What did I do wrong?
    > >
    > > Application.CommandBars.("Worksheet Menu Bar").Enabled = False

    >
    >
    >


  5. #5
    Ron de Bruin
    Guest

    Re: VB code changed Excel settings for all worksheets

    Sure

    Use this events in the thisworkbook module

    Private Sub Workbook_Activate()
    Application.CommandBars("Worksheet Menu Bar").Enabled = False
    End Sub

    Private Sub Workbook_Deactivate()
    Application.CommandBars("Worksheet Menu Bar").Enabled = True
    End Sub


    --
    Regards Ron de Bruin
    http://www.rondebruin.nl



    "JenniferMc" <[email protected]> wrote in message news:[email protected]...
    > Can this code run when the document is closed so that only the specific
    > workbook is impacted?
    >
    > "Ron de Bruin" wrote:
    >
    >> Hi JenniferMc
    >>
    >> Open Excel
    >> Alt-F11
    >> Insert module
    >> Paste the sub
    >> Alt-Q
    >>
    >> Alt-F8
    >> Select test
    >> Run
    >>
    >> Sub test()
    >> Application.CommandBars("Worksheet Menu Bar").Enabled = True
    >> End Sub
    >>
    >>
    >>
    >> --
    >> Regards Ron de Bruin
    >> http://www.rondebruin.nl
    >>
    >>
    >>
    >> "JenniferMc" <[email protected]> wrote in message news:[email protected]...
    >> >I used the following vb code in a file to disable a the menu items. Now
    >> > every time I open Excel the Menu is not there.
    >> > Green around the gills with vb. What did I do wrong?
    >> >
    >> > Application.CommandBars.("Worksheet Menu Bar").Enabled = False

    >>
    >>
    >>




+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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