+ Reply to Thread
Results 1 to 7 of 7

Options when workbook opens

Hybrid View

  1. #1
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Options when workbook opens

    Hello Again!

    I would really like to know if there is a way that when my workbook opens if the following can happen?

    - Not display the tabs (NOT "HIDE" the sheets, just not be able to view the tabs themselves)
    - Go to full screen (not display ribbon)


    Thanks!
    Last edited by rbyrd023; 01-31-2010 at 03:26 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Options when workbook opens

    hello.

    please try.
    Sub HideRibbon()
    
    With Application
        .ScreenUpdating = False
        .ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"
        .DisplayFormulaBar = False
        .ScreenUpdating = True
    End With
    
    ActiveWindow.DisplayWorkbookTabs = False
    
    End Sub
    
    Sub ShowRibbon()
    
    With Application
        .ScreenUpdating = False
        .ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
        .DisplayFormulaBar = True
        .ScreenUpdating = True
    End With
    
    ActiveWindow.DisplayWorkbookTabs = True
    
    End Sub
    Edit
    you will also need this in the THISWORKBOOK code section.
    Private Sub Workbook_Activate()
    HideRibbon
    End Sub
    
    Private Sub Workbook_Open()
    HideRibbon
    End Sub
    
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    ShowRibbon
    End Sub
    
    Private Sub Workbook_Deactivate()
    ShowRibbon
    End Sub
    hope this helps
    Last edited by D_Rennie; 01-31-2010 at 02:04 AM.


  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,342

    Re: Options when workbook opens

    Hi rbyrd023
    the first part

    Private Sub Workbook_BeforeClose(Cancel As Boolean)
       ActiveWindow.DisplayWorkbookTabs = True
    End Sub
    Private Sub Workbook_Open()
     ActiveWindow.DisplayWorkbookTabs = False
    End Sub
    but why dont you want thr ribbon desplayed?
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Options when workbook opens

    Perhaps like this:

    Sub Auto_open()
    '
    '
    With ActiveWindow
    .DisplayHeadings = False
    .DisplayWorkbookTabs = False
    End With
    End Sub
    HTH

    Alf

  5. #5
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Options when workbook opens

    Thanks for all the help! To: D_Rennie ,Works great when opening but when a userform is closed using "Unload Me" it goes back to showing everything! Anyway to stop that or to close a userform with different verbage?

  6. #6
    Valued Forum Contributor
    Join Date
    05-14-2009
    Location
    gold coast
    MS-Off Ver
    Excel 2007
    Posts
    843

    Re: Options when workbook opens

    ok i dont know why the unload of the userform is triggring any of the procudures above,
    you could use me.hide. or enableeventss = false befor the unload and enableevents= true after the unload.

    it could be becouse the focus is going elsewhere and comming back to this workbook in a strange way, try the enableevents 1st.

    if neither work can you post a workbook.
    cheers.

  7. #7
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Options when workbook opens

    OK very wierd! Only one userform makes it do that and I'm not to concerned about that one! Thank you for your help!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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