Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 309
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,533
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 489
Default 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
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
Userform problem with "obj doesn't support this property or method"error message. Chet Excel Programming 0 August 12th 09 05:26 PM
Problem with "ThisWorkbook.Saved" property. mickey Excel Programming 6 January 2nd 07 02:48 PM
Prevent code in "Sheet Activate" from running when sheet made visible from other macr Simon Lloyd[_794_] Excel Programming 10 June 21st 06 09:15 AM
Multiple "Range" with "Cells" property? jopu[_2_] Excel Programming 3 November 18th 04 04:05 PM
Multiple "Range" with "Cells" property? jopu Excel Programming 2 November 18th 04 02:38 PM


All times are GMT +1. The time now is 01:18 PM.

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

About Us

"It's about Microsoft Excel"