Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Created a workbook with 12 sheets for some clients.
Have the following VBA code used to hide all the toolbars when opening And unhide when closing the workbook. Dim aryCBs Private Sub Workbook_BeforeClose(Cancel As Boolean) Dim i As Long For i = LBound(aryCBs) To UBound(aryCBs) Application.CommandBars(aryCBs(i)).Visible = True Next i ActiveWorkbook.Save End Sub Private Sub Workbook_Open() Dim oCB As CommandBar Dim i As Long Application.ScreenUpdating = False Application.DisplayFormulaBar = False ReDim aryCBs(0) For Each oCB In Application.CommandBars If oCB.Visible Then If oCB.Name < "Worksheet Menu Bar" Then ReDim Preserve aryCBs(i) aryCBs(i) = oCB.Name oCB.Visible = False i = i + 1 End If End If Next oCB Application.ScreenUpdating = True End Sub A single customer says that he gets a run time error when closing th workbook. And it appears in the following code: Application.CommandBars(aryCBs(i)).Visible = True He is running the same version of Excel (97) as I am. I have tried t duplicate this error and cannot!\ Anybody have an idea as to why he is the only one with this problem ou of all my customers? Appreciate the help -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Error Run Time Error, Type Mismatch | Excel Discussion (Misc queries) | |||
run-time error '91'-Close Button error | Excel Discussion (Misc queries) | |||
Run time error 1004, General ODBC error | New Users to Excel | |||
Run-time error '11' & Run-time error '1004' | Excel Programming | |||
Run-time error '11' & Run-time error '1004' | Excel Programming |