LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default can't hide workbook or trap error

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?

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Handling - On Error GoTo doesn't trap error successfully David Excel Programming 9 February 16th 06 05:59 PM
Error Trap Kirk P. Excel Programming 2 September 8th 05 09:51 PM
Error Trap TEB2 Excel Programming 2 March 15th 05 05:34 PM
error trap Rhonda[_3_] Excel Programming 2 October 22nd 03 07:07 PM


All times are GMT +1. The time now is 10:43 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"