+ Reply to Thread
Results 1 to 2 of 2

Ribbon not showing on new workbook

  1. #1
    Registered User
    Join Date
    01-22-2021
    Location
    halifax
    MS-Off Ver
    2016
    Posts
    2

    Ribbon not showing on new workbook

    Hi, newbie at vba.

    The issue i am having is the ribbon is hidden on my current workbook (this is what i intended for this workbook), however when opening a new workbook with present one still open the ribbon/toolbar will not show e.g. to format, allign and so on.

    My this workbook code is:

    Private Sub Workbook_Open()


    ActiveSheet.ScrollArea = "A1:A1"
    Application.ScreenUpdating = True
    Application.DisplayStatusBar = Not Application.DisplayStatusBar
    Application.CommandBars("Worksheet Menu Bar").Enabled = False
    Application.DisplayFormulaBar = False
    Application.DisplayStatusBar = False
    Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",False)"

    With ActiveWindow
    .DisplayHeadings = False
    .DisplayHorizontalScrollBar = False
    .DisplayVerticalScrollBar = False
    .DisplayWorkbookTabs = False
    End With
    ActiveSheet.DisplayPageBreaks = False

    ' Sub NoEsc()
    Application.OnKey "{ESC}", "NoChange"

    End Sub


    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    Application.ScreenUpdating = False
    Application.ExecuteExcel4Macro "SHOW.TOOLBAR(""Ribbon"",True)"
    Application.DisplayFormulaBar = True
    Application.DisplayStatusBar = True
    ActiveWindow.DisplayWorkbookTabs = True
    ActiveWorkbook.Close SaveChanges:=False

    End Sub

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

    If SaveAsUI Then
    MsgBox "The 'Save As' function has been disabled." & _
    Chr(10) & "For Review Purpose Only, to request changes please use the email function.", vbInformation, "Save As Disabled"
    Cancel = True
    End If

    End Sub
    Last edited by hasanaat; 01-22-2021 at 12:51 PM.

  2. #2
    Registered User
    Join Date
    01-22-2021
    Location
    halifax
    MS-Off Ver
    2016
    Posts
    2

    Re: Ribbon not showing on new workbook

    Please see attached image to understand what i mean:

    Attachment 714713

+ 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. [SOLVED] Hide ribbon/formula bar for this workbook only
    By benjhardie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-17-2020, 12:49 AM
  2. [SOLVED] Customize Ribbon attached to a workbook
    By Joakim N in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-19-2018, 05:07 AM
  3. Full ribbon not showing
    By T De Villiers in forum Excel General
    Replies: 0
    Last Post: 02-20-2018, 01:35 PM
  4. How to create new workbook with custom ribbon in VBA
    By MichalJB in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-25-2013, 02:52 PM
  5. Disable Ribbon Tab When No Workbook is Open
    By bambaataa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-20-2012, 04:34 AM
  6. Hide Ribbon on Workbook Open
    By HangMan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2012, 09:14 PM
  7. Excel 2007 : Hiding and Showing Excel 2007 Ribbon
    By LoveCandle in forum Excel General
    Replies: 8
    Last Post: 01-25-2010, 03:51 AM

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