workbooks keep hiding

Giganews Newsgroups
Subject: workbooks keep hiding
Posted by:  mr.davidmorris…@gmail.com
Date: 21 May 2006

how do you stop all the inactive workbooks from hiding I was using this
code to hide everything and now whenever I have two or more workbooks
open only the active one shows
I have the same code for workbook deactivate and activate

Private Sub Workbook_Open()
    With ActiveWindow
        .DisplayGridlines = False
        .DisplayHeadings = False
        .DisplayHorizontalScrollBar = False
        .DisplayVerticalScrollBar = False
        .DisplayWorkbookTabs = False
    With Application
        .DisplayFormulaBar = False
        .DisplayStatusBar = False
    End With

    End With
  Dim TBarCount As Integer
Dim cbar As CommandBar
Sheets("sheet1").Range("A:A").ClearContents
TBarCount = 0
For Each cbar In Application.CommandBars
    If cbar.Type = msoBarTypeNormal Then
        If cbar.Visible Then
            TBarCount = TBarCount + 1
            Sheets("sheet1").Cells(TBarCount, 1) = cbar.Name
            cbar.Visible = False
        End If
    End If
Next cbar
Sheets("Information").Select
Range("A3").Select
    ActiveWindow.Zoom = 95

End Sub
Private Sub Workbook_Activate()
    With ActiveWindow
        .DisplayGridlines = False
        .DisplayHeadings = False
        .DisplayHorizontalScrollBar = False
        .DisplayVerticalScrollBar = False
        .DisplayWorkbookTabs = False
    With Application
        .DisplayFormulaBar = False
        .DisplayStatusBar = False
    End With

    End With
  Dim TBarCount As Integer
Dim cbar As CommandBar
Sheets("sheet1").Range("A:A").ClearContents
TBarCount = 0
For Each cbar In Application.CommandBars
    If cbar.Type = msoBarTypeNormal Then
        If cbar.Visible Then
            TBarCount = TBarCount + 1
            Sheets("sheet1").Cells(TBarCount, 1) = cbar.Name
            cbar.Visible = False
        End If
    End If
Next cbar
Sheets("Information").Select
Range("A3").Select
    ActiveWindow.Zoom = 95

End Sub

Replies