Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel 97 Workbook_Open problem


Hi,

I have a problem with xl 97. I have the following code in m
workbook_open event:-

Private Sub workbook_open()
Application.ScreenUpdating = False
Call CheckMacrosEnabled 'Sets all the sheets to be visible
Call Toolbar
Call UpdateContents
ThisWorkbook.Sheets("Cover Sheet").Select
Application.ScreenUpdating = True
End Sub

Public Sub CheckMacrosEnabled() - is just a simple function that loop
through all the pages and then sets the sheets to be visible.

This works fine in XP.

In xl 97, on open, the CheckMacrosEnabled subroutine is called, but i
unable to set the visible state of the sheets (from 2 to -1). However
once the workbook is open, by running the workbook_open event from th
VBA editor CheckMacrosEnabled is called and can make the sheet
visible.

The line ThisWorkbook.Sheets("Cover Sheet").Select should also give a
error as it cannot make any of the sheets visible, and so the cove
sheet is hidden and so this should give an error but doesn't.

Just wondered if anyone could shed any light on this? Thanks i
advance,


Richar

--
cassidyr
-----------------------------------------------------------------------
cassidyr1's Profile: http://www.excelforum.com/member.php...nfo&userid=734
View this thread: http://www.excelforum.com/showthread.php?threadid=27240

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Excel 97 Workbook_Open problem

I can't duplicate the problem. This code runs fine for me under Excel 97:

Private Sub Workbook_Open()
ShowSheets
End Sub

Sub ShowSheets()
Dim Counter As Integer
For Counter = 2 To 4
Worksheets("Sheet" & Counter).Visible = True
Next
End Sub

I saved the workbook with sheets 2-4 very hidden. Does this run for you?
If so maybe there are other things your code is doing that causes the
problem

--
Jim Rech
Excel MVP
"cassidyr1" wrote in message
...
|
| Hi,
|
| I have a problem with xl 97. I have the following code in my
| workbook_open event:-
|
| Private Sub workbook_open()
| Application.ScreenUpdating = False
| Call CheckMacrosEnabled 'Sets all the sheets to be visible
| Call Toolbar
| Call UpdateContents
| ThisWorkbook.Sheets("Cover Sheet").Select
| Application.ScreenUpdating = True
| End Sub
|
| Public Sub CheckMacrosEnabled() - is just a simple function that loops
| through all the pages and then sets the sheets to be visible.
|
| This works fine in XP.
|
| In xl 97, on open, the CheckMacrosEnabled subroutine is called, but is
| unable to set the visible state of the sheets (from 2 to -1). However,
| once the workbook is open, by running the workbook_open event from the
| VBA editor CheckMacrosEnabled is called and can make the sheets
| visible.
|
| The line ThisWorkbook.Sheets("Cover Sheet").Select should also give an
| error as it cannot make any of the sheets visible, and so the cover
| sheet is hidden and so this should give an error but doesn't.
|
| Just wondered if anyone could shed any light on this? Thanks in
| advance,
|
|
| Richard
|
|
| --
| cassidyr1
| ------------------------------------------------------------------------
| cassidyr1's Profile:
http://www.excelforum.com/member.php...fo&userid=7349
| View this thread: http://www.excelforum.com/showthread...hreadid=272408
|


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
Problem with Workbook_open Vick Excel Discussion (Misc queries) 13 February 14th 06 10:40 PM
excel vba workbook_open event does not work help please newyuppie[_3_] Excel Programming 2 May 21st 04 09:03 AM
Workbook_Open problem TroyH Excel Programming 4 April 13th 04 11:56 AM
problem with code in workbook_open event Dominique Schroeder Excel Programming 3 April 7th 04 01:56 AM
Workbook_Open macro created in Excel 97 problems on MAC Dick Kusleika Excel Programming 2 September 8th 03 06:42 PM


All times are GMT +1. The time now is 10:34 AM.

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"