Hi Brian
The code below is about as good as you will get:
Private Sub Workbook_Open()
With ActiveWindow
.DisplayHeadings = False
.DisplayWorkbookTabs = False
End With
Worksheets("Report").Activate
End Sub
The user will see them for a second as the Window must activate first. It's not possible to display only one Tab. It's all or nothing I'm afraid. You could of course create a simple Commandbar with the sheets name and have Docked and Locked at the very bottom of your screen.
Dim cButton As CommandBarButton
Private Sub Workbook_Activate()
On Error Resume Next
Application.CommandBars("MyBar").Visible = True
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim bIsClosed As Boolean
If Cancel = True Then Exit Sub
On Error Resume Next
Application.CommandBars("MyBar").Delete
End Sub
Private Sub Workbook_Deactivate()
On Error Resume Next
Application.CommandBars("MyBar").Visible = True
End Sub
Private Sub Workbook_Open()
With ActiveWindow
.DisplayHeadings = False
.DisplayWorkbookTabs = False
End With
On Error Resume Next
Application.CommandBars("MyBar").Delete
Application.CommandBars.Add "MyBar", msoBarBottom
Set cButton = Application.CommandBars("MyBar").Controls.Add(msoControlButton)
With cButton
.OnAction = "ReportShow"
.Caption = "Report"
.Style = msoButtonCaption
End With
Application.CommandBars("MyBar").Visible = True
Application.CommandBars("MyBar").Protection = msoBarNoMove
Worksheets("Report").Activate
End Sub
The "ReportShow" would be a standard macro that would activate you sheet.
Dave
OzGrid Business Applications
Thanks very much Dave! as usual - Huge help.
The "ReportShow" would be a standard macro that would activate you sheet. Dave