Results 1 to 3 of 3

Hiding the ribbon ONLY in my workbook, but not in other open workbooks?

Threaded View

jonvanwyk Hiding the ribbon ONLY in my... 03-25-2011, 04:52 PM
royUK Re: Hiding the ribbon ONLY in... 03-26-2011, 05:23 AM
Andy Pope Re: Hiding the ribbon ONLY in... 03-26-2011, 07:32 AM
  1. #1
    Forum Contributor jonvanwyk's Avatar
    Join Date
    06-28-2010
    Location
    Iowa, USA
    MS-Off Ver
    Excel 2010
    Posts
    452

    Hiding the ribbon ONLY in my workbook, but not in other open workbooks?

    I have VBA that hides my ribbon (seen below). My only problem is, when people open other workbooks, it hides their ribbon as long as the file that contains the code below is open. How do I make it so my hide ribbon code applies only to this workbook, even if one or more unrelated workbooks are open?

    
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
    Application.DisplayStatusBar = True
    End Sub
    
    Private Sub Workbook_Deactivate()
    Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
    Application.DisplayStatusBar = True
    End Sub
    
    Private Sub Workbook_Open()
    Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
    Application.DisplayFormulaBar = False
    Worksheets("Menu").Select
    Application.DisplayStatusBar = False
     
    End Sub
    
    Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    Application.ExecuteExcel4Macro "show.toolbar(""Ribbon"",False)"
    Application.DisplayFormulaBar = False
    Application.DisplayStatusBar = False
    If IsNumeric(Sh.Name) Then
    Sh.ScrollArea = "A1:O30"
    Else
    Sh.ScrollArea = "A1:M12"
    End If
    End Sub
    Last edited by jonvanwyk; 03-28-2011 at 11:38 AM.

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