I have a template where when it is closed, all but one sheet is visible(sheet10); all the rest of the sheets are veryhidden. Sheet10 has a screen shot of a msgbox stating that macros must be enabled to use this template. Once the macros are enabled, sheet10 is then veryhidden and the applicable sheets are visible. When running the code though I get an "Object doesn't support this property or method" message. The code is as follows:
Code
Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheet10.Visible = xlSheetVisible
Sheet10.ScrollArea = "A1:Q80"
Sheet10.Activate
Sheet10.Range("a1").Select
Dim wrksht As Worksheet
For Each wrksht In ActiveWorkbook.Worksheets
wrksht.ScrollArea = ""
Next wrksht
For Each wrksht In ActiveWorkbook.Worksheets
If wrksht.Name <> Sheet10 Then '<== THIS IS WHERE THE ERROR OCCURS
wrksht.Visible = xlSheetVeryHidden
End If
Next wrksht
End Sub
Display More
What do I need to do to make this work?
Thx - Ray