ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2007 worksheet visible problem (https://www.excelbanter.com/excel-programming/392592-excel-2007-worksheet-visible-problem.html)

[email protected]

Excel 2007 worksheet visible problem
 
I have a module that has been working just fine under Excel 2003. I
am now testing it under Excel 2007, in preparation for a rollout of
Office 2007 that will start next week. It runs from a workbook that
has a number of hidden sheets, and contains the following code:

'MsgBox ("1")
ThisWorkbook.Worksheets("Q&A").Visible = True
ThisWorkbook.Worksheets("Q&A").PageSetup.RightFoot er = "Program
Checklist Revision " & revno
'MsgBox ("2")
ThisWorkbook.Worksheets("DocInfo").Visible = True
ThisWorkbook.Worksheets("DocInfo").PageSetup.Right Footer = "Program
Checklist Revision " & revno
'MsgBox ("3")

The msgbox lines are all commented. Under Excel 2007, it crashes on
the 5th line, with a message about being unable to get the worksheet
visible property. When I remove the comment from line 4, I get the
message box and no error. I then put the comment back, and saved, and
again got no error. However, I am nervous about someone getting the
error at some random time, since I can't figure out what caused it,
and what cured it. Does anyone have any ideas?


Bob Phillips

Excel 2007 worksheet visible problem
 
Try

ThisWorkbook.Worksheets("Q&A").Visible = xlSheetVisible

and

ThisWorkbook.Worksheets("DocInfo").Visible = xlSheetVisible

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message
ps.com...
I have a module that has been working just fine under Excel 2003. I
am now testing it under Excel 2007, in preparation for a rollout of
Office 2007 that will start next week. It runs from a workbook that
has a number of hidden sheets, and contains the following code:

'MsgBox ("1")
ThisWorkbook.Worksheets("Q&A").Visible = True
ThisWorkbook.Worksheets("Q&A").PageSetup.RightFoot er = "Program
Checklist Revision " & revno
'MsgBox ("2")
ThisWorkbook.Worksheets("DocInfo").Visible = True
ThisWorkbook.Worksheets("DocInfo").PageSetup.Right Footer = "Program
Checklist Revision " & revno
'MsgBox ("3")

The msgbox lines are all commented. Under Excel 2007, it crashes on
the 5th line, with a message about being unable to get the worksheet
visible property. When I remove the comment from line 4, I get the
message box and no error. I then put the comment back, and saved, and
again got no error. However, I am nervous about someone getting the
error at some random time, since I can't figure out what caused it,
and what cured it. Does anyone have any ideas?




[email protected]

Excel 2007 worksheet visible problem
 
I just tried changing "true" to xlsheetvisible, and the error
reappeared! I'm completely stumped now.
Felsa

On Jul 3, 11:52 am, "Bob Phillips" wrote:
Try

ThisWorkbook.Worksheets("Q&A").Visible= xlSheetVisible

and

ThisWorkbook.Worksheets("DocInfo").Visible= xlSheetVisible

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

wrote in message

ps.com...



I have a module that has been working just fine underExcel2003. I
am now testing it underExcel2007, in preparation for a rollout of
Office2007that will start next week. It runs from a workbook that
has a number of hidden sheets, and contains the following code:


'MsgBox ("1")
ThisWorkbook.Worksheets("Q&A").Visible= True
ThisWorkbook.Worksheets("Q&A").PageSetup.RightFoot er = "Program
Checklist Revision " & revno
'MsgBox ("2")
ThisWorkbook.Worksheets("DocInfo").Visible= True
ThisWorkbook.Worksheets("DocInfo").PageSetup.Right Footer = "Program
Checklist Revision " & revno
'MsgBox ("3")


The msgbox lines are all commented. UnderExcel2007, it crashes on
the 5th line, with a message about being unable to get the worksheet
visibleproperty. When I remove the comment from line 4, I get the
message box and no error. I then put the comment back, and saved, and
again got no error. However, I am nervous about someone getting the
error at some random time, since I can't figure out what caused it,
and what cured it. Does anyone have any ideas?- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 11:42 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com