Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with ".Visible" sheet property
When someone initially opens a workbook, the "Workbook_Open"
subroutine is immediately executed. Here are the first few lines of the Workbook_Open() subroutine: Sheet15.Visible = xlVeryHidden Sheet16.Visible = xlVeryHidden Sheet17.Visible = xlVeryHidden Sheet18.Visible = xlVeryHidden This code is executed just to ensure that sheets 15 through 18 are always hidden, even if the sheets are already hidden. So far, this code has never failed or ever caused any problems at all.....until NOW! One of my users seems to have accidentally created a situation where the above code will immediately crash at the first line "Sheet15.Visible = xlVeryHidden" and I have no idea why this is happening. The above code works fine on everybody else's workbooks, but how could the code NOT be working for just one user???? Are there any Excel settings or buttons that the user might have pressed which could be causing this??? Is there any way I could fix this?? BTW, the error message which occurred states "Method 'Visible' of object Worksheet failed". thank you |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with ".Visible" sheet property
Hi
Check if the workbook has been protected, as a protected workbook will cause this error. Hopes this helps. .... Per "Robert Crandal" skrev i meddelelsen ... When someone initially opens a workbook, the "Workbook_Open" subroutine is immediately executed. Here are the first few lines of the Workbook_Open() subroutine: Sheet15.Visible = xlVeryHidden Sheet16.Visible = xlVeryHidden Sheet17.Visible = xlVeryHidden Sheet18.Visible = xlVeryHidden This code is executed just to ensure that sheets 15 through 18 are always hidden, even if the sheets are already hidden. So far, this code has never failed or ever caused any problems at all.....until NOW! One of my users seems to have accidentally created a situation where the above code will immediately crash at the first line "Sheet15.Visible = xlVeryHidden" and I have no idea why this is happening. The above code works fine on everybody else's workbooks, but how could the code NOT be working for just one user???? Are there any Excel settings or buttons that the user might have pressed which could be causing this??? Is there any way I could fix this?? BTW, the error message which occurred states "Method 'Visible' of object Worksheet failed". thank you |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Problem with ".Visible" sheet property
Is the workbook on a network server drive or is it saved locally on
individuals computers? If it's saved locally, it seems to me that the user has protected the workbook. You could manually unprotect Put this code in the Workbook Open Event. This code will unprotect the workbook, hide the sheets, then unprotect the workbook. Hope this helps! If so, let me know, click "YES" below. Private Sub Workbook_Open() With ThisWorkbook .Unprotect "Your Password Here" .Sheets("Sheet15").Visible = xlVeryHidden .Sheets("Sheet16").Visible = xlVeryHidden .Sheets("Sheet17").Visible = xlVeryHidden .Sheets("Sheet18").Visible = xlVeryHidden .Protect "Your Password Here" End With End Sub -- Cheers, Ryan "Robert Crandal" wrote: When someone initially opens a workbook, the "Workbook_Open" subroutine is immediately executed. Here are the first few lines of the Workbook_Open() subroutine: Sheet15.Visible = xlVeryHidden Sheet16.Visible = xlVeryHidden Sheet17.Visible = xlVeryHidden Sheet18.Visible = xlVeryHidden This code is executed just to ensure that sheets 15 through 18 are always hidden, even if the sheets are already hidden. So far, this code has never failed or ever caused any problems at all.....until NOW! One of my users seems to have accidentally created a situation where the above code will immediately crash at the first line "Sheet15.Visible = xlVeryHidden" and I have no idea why this is happening. The above code works fine on everybody else's workbooks, but how could the code NOT be working for just one user???? Are there any Excel settings or buttons that the user might have pressed which could be causing this??? Is there any way I could fix this?? BTW, the error message which occurred states "Method 'Visible' of object Worksheet failed". thank you . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform problem with "obj doesn't support this property or method"error message. | Excel Programming | |||
Problem with "ThisWorkbook.Saved" property. | Excel Programming | |||
Prevent code in "Sheet Activate" from running when sheet made visible from other macr | Excel Programming | |||
Multiple "Range" with "Cells" property? | Excel Programming | |||
Multiple "Range" with "Cells" property? | Excel Programming |