G
Guest
I'm trying to hide the workbook that contains my macro library. This used to
work, but has suddenly failed in 2 ways: the line "wb.Visible = False"
produces the error "Object doesn't support this property or method" and the
error is not trapped.
Sub auto_open()
Dim i&, wb
For i& = 1 To Workbooks.Count
Set wb = Workbooks(i&)
If InStr(UCase$(wb.Name), "PERSONAL.XLS") Then GoSub HideWB
If InStr(UCase$(wb.Name), "CUSTOM.XLS") Then GoSub HideWB
Next i&
Exit Sub
HideWB:
On Error GoTo SkipHide
wb.Visible = False
SkipHide:
On Error GoTo 0
Return
End Sub
What could be going wrong?
work, but has suddenly failed in 2 ways: the line "wb.Visible = False"
produces the error "Object doesn't support this property or method" and the
error is not trapped.
Sub auto_open()
Dim i&, wb
For i& = 1 To Workbooks.Count
Set wb = Workbooks(i&)
If InStr(UCase$(wb.Name), "PERSONAL.XLS") Then GoSub HideWB
If InStr(UCase$(wb.Name), "CUSTOM.XLS") Then GoSub HideWB
Next i&
Exit Sub
HideWB:
On Error GoTo SkipHide
wb.Visible = False
SkipHide:
On Error GoTo 0
Return
End Sub
What could be going wrong?