I was asked to repost this into a new thread. The old thread has a wealth of information so I hate repeating it... Old Link
So my menu bar is missing completely, formula bar, rows, columns, file bar. This was an unexpected side-effect of some code I was working with in vb.net, however I changed reversed the changes in vb.net and the problem persists. Here is my vb.net code:
'CODE FOR DISABLING EXCEL FEATURES
Sub HideAllMenus(app As Excel.Application)
With app
.DisplayFormulaBar = False
.DisplayStatusBar = False
.CommandBars("Worksheet Menu Bar").Enabled = False
.CommandBars("Standard").Visible = False
.CommandBars("Formatting").Visible = False
If CDbl(.Version) >= 12.0# Then
If .ExecuteExcel4Macro("Get.ToolBar(7,""Ribbon"")") Then
.ExecuteExcel4Macro("Show.ToolBar(""Ribbon"", False)")
End If
End If
End With
End Sub
'CODE FOR DISABLING EXCEL FEATURES
Sub HideRowColHeadings(wb As Excel.Workbook)
Dim window As Excel.window
For Each window In wb.Windows
window.DisplayHeadings = False
Next
End Sub
And this code to restore it:
Sub RestoreAllMenus(app As Excel.Application)
With app
.DisplayFormulaBar = True
.DisplayStatusBar = True
.CommandBars("Worksheet Menu Bar").Enabled = True
.CommandBars("Standard").Visible = True
.CommandBars("Formatting").Visible = True
If CDbl(.Version) >= 12.0# Then
.ExecuteExcel4Macro("Show.ToolBar(""Ribbon"", True)")
End If
End With
End Sub
Sub ShowRowColHeadings(wb As Excel.Workbook)
Dim window As Excel.window
For Each window In wb.Windows
window.DisplayHeadings = True
Next
End Sub
The application was working totally fine all week until now for no apparent reason. Now I can't access the menu bar or controls at all. Completely missing! First, I tried correcting it in vb.net and it worked on that one sheet when I ran the application, but as soon as I closed down my application, all other workbooks I load up are missing the bar! I tried using this code in vba using Alt+F11, then Alt+F8 to run it, but nothing happened, nothing at all! EDIT: I added the top line of code and now the FORMULA BAR is displaying but still nothing else. Any help much appreciated: EDIT-2: FYI, when I edit it in vb.net, I can restore all settings, but in Excel, they are gone.
'VBA Code
Sub Enable_Menu_Bar()
Application.DisplayFormulaBar = True
Application.StatusBar = True
CommandBars("Worksheet Menu Bar").Enabled = True
CommandBars("Standard").Visible = True
CommandBars("Formatting").Visible = True
ActiveWindow.DisplayHeadings = True
' Window.DisplayHeadings = True
End Sub
Bookmarks