+ Reply to Thread
Results 1 to 7 of 7

no menu's

  1. #1
    Forum Contributor
    Join Date
    06-15-2004
    Posts
    246

    no menu's

    Hi,

    I would like to set my excel workbook up so that i dont see any menu's rows or anything. This is to give it the look like it is a non excel application. I would need it to only be aplicable to this workbook and so that any other excel books there were opened would beopened in a separate regular book.

  2. #2
    Philip
    Guest

    RE: no menu's

    Hi,

    To make all other workbooks open in a separate Excel window, you need to set
    the Application property 'IgnorRemoterequests' to True when your special
    workbook is opened, and false when it is closed (this is the same as checking
    the box in the Options dialog for 'Ignore Remote Applications')

    To disable all commandbars, you loop through the Commandbars collection,
    setting each members 'Enabled' property to False, and reset them when the
    workbook is closed.

    So, in the VB Editor of Excel, in the Workbook_open event procedure of the
    ThisWorkbook class module, you would put code like this:

    >>>> CODE SAMPLE >>>

    dim xBar as commandbar

    ' DISABLE ALL COMMANDBARS, TGOOLBARS, MENUS !!!
    for each xbar in commandbars ' includes menus, AND commandbars!
    xbar.enabled=false
    next

    application.ignoreremoterequests=true
    <<< END <<<

    and in the workbook_close event handler of the same module, you would have
    code like this:

    >>>> SAMPLE CODE >>>

    dim xBar as commandbar

    ' DISABLE ALL COMMANDBARS, TGOOLBARS, MENUS !!!
    for each xbar in commandbars ' includes menus, AND commandbars!
    xbar.enabled=true
    next

    application.ignoreremoterequests=false

    <<< END <<<

    BTW, this also prevents anyone using the Toolbar List menu...but anyone can
    double-click on the area at the top of the Excel window, and they get the
    Customize Commandbars dialog, which allows them to add their own commandbars
    and menus...

    In Office XP (or is it 2002/2003 ?), you can disable this feature by setting
    the "application.commandbars.disablecustomize" property to true, and reset it
    when the workbook is closed.

    BTW:
    If Excel crashes, then the Workbook_Close event will not fire, so next time
    you open Excel it may still have all the menus and commandbars disabled, and
    the only way to reset them is using the code above (close event).

    Also, unless you prevent people having access to the VB Editor and the
    workbooks VB Project, they can easily open up the VB Editor (ALT-F11, or
    ALT-F8 in MS Excel) and run some code to reset the menus - to get around that
    you have to disable keystrokes using the OnKey property of the Application
    object (yes, reset the defaults when the workbook is closed)

    If you leave the property 'ignoreremoterequests' set to false, then Windows
    will give you an error when you double-click on a file in Explorer to open
    it, or when you double-click an attachment in MS Outlook, so be aware that
    this property needs to be reset when the workbook is closed, or, next time
    you open Excel, on the Tools menu, Options dialog, you can uncheck the box
    that says 'Ignore remote applications'

    HTH

    Philip

    "ceemo" wrote:

    >
    > Hi,
    >
    > I would like to set my excel workbook up so that i dont see any menu's
    > rows or anything. This is to give it the look like it is a non excel
    > application. I would need it to only be aplicable to this workbook and
    > so that any other excel books there were opened would beopened in a
    > separate regular book.
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
    > View this thread: http://www.excelforum.com/showthread...hreadid=396411
    >
    >


  3. #3
    Bob Phillips
    Guest

    Re: no menu's

    Option Explicit

    Private mFormulaBar

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Dim oCB As CommandBar
    For Each oCB In Application.CommandBars
    oCB.Enabled = True
    Next oCB

    Application.DisplayFormulaBar = mFormulaBar
    End Sub

    Private Sub Workbook_Open()
    Dim oCB As CommandBar
    For Each oCB In Application.CommandBars
    oCB.Enabled = False
    Next oCB

    mFormulaBar = Application.DisplayFormulaBar
    Application.DisplayFormulaBar = False
    End Sub

    'This is workbook event code.
    'To input this code, right click on the Excel icon on the worksheet
    '(or next to the File menu if you maximise your workbooks),
    'select View Code from the menu, and paste the code



    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "ceemo" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Hi,
    >
    > I would like to set my excel workbook up so that i dont see any menu's
    > rows or anything. This is to give it the look like it is a non excel
    > application. I would need it to only be aplicable to this workbook and
    > so that any other excel books there were opened would beopened in a
    > separate regular book.
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile:

    http://www.excelforum.com/member.php...o&userid=10650
    > View this thread: http://www.excelforum.com/showthread...hreadid=396411
    >




  4. #4
    Forum Contributor
    Join Date
    06-15-2004
    Posts
    246

    Thnx

    Wow thanks peeps just what i wanted

  5. #5
    Forum Contributor
    Join Date
    06-15-2004
    Posts
    246

    Question

    Ive had a play with the function that stops other books being opened in the same excel application.

    If there is already a book open it will close the menu's from that book as well is there anyway around this?

  6. #6
    Ron de Bruin
    Guest

    Re: no menu's

    Hi

    Use the activate and deactivate events
    See
    http://www.rondebruin.com/menuid.htm



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


    "ceemo" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Ive had a play with the function that stops other books being opened in
    > the same excel application.
    >
    > If there is already a book open it will close the menu's from that book
    > as well is there anyway around this?
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile: http://www.excelforum.com/member.php...o&userid=10650
    > View this thread: http://www.excelforum.com/showthread...hreadid=396411
    >




  7. #7
    Bob Phillips
    Guest

    Re: no menu's

    Uh, I don't think I know what you are talking about.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "ceemo" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Ive had a play with the function that stops other books being opened in
    > the same excel application.
    >
    > If there is already a book open it will close the menu's from that book
    > as well is there anyway around this?
    >
    >
    > --
    > ceemo
    > ------------------------------------------------------------------------
    > ceemo's Profile:

    http://www.excelforum.com/member.php...o&userid=10650
    > View this thread: http://www.excelforum.com/showthread...hreadid=396411
    >




+ 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