Could someone please fix this code for me...


Posted by Jubo on April 28, 2001 3:40 AM

Could someone please fix this code for me..thanks..
When I run it...I get an error..I'm using Excel 97


Private Sub Workbook_BeforeClose(Cancel As Boolean)
Worksheets("Macros Not enabled").Visible = True
for Each ws In Worksheets
If ws.Name <> "Macros Not Enabled" Then ws.Visible = xlVeryHidden
Next
End Sub

Private Sub Workbook_Open()
For Each ws In Worksheets
If ws.Name <> "Macros Not Enabled" Then ws.Visible = True
Next
Worksheets("Macros Not Enabled").Visible = xlVeryHidden
End Sub


Posted by Dax on April 28, 2001 9:01 AM

Hi,
Just change the True in the line saying Worksheets("Macros Not enabled")=True to xlSheetVisible.

Regards,
Dax.



Posted by Jubo on April 28, 2001 9:15 AM