Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open 'n' Hide


Hi all,

I'm trying to run a piece of VB that, on opening the spreadsheet, hide
a number of worksheets and also takes the user to a predefined sheet
Here's what I tried:

Private Sub Workbook_Open()

Sheets("User Select").Activate
Sheets("Programme(High Level)").Visible = xlVeryHidden
Sheets("Programme (2 Week)").Visible = xlVeryHidden
Sheets("Programme (Components").Visible = xlVeryHidden
Sheets("Capacity").Visible = xlVeryHidden
Sheets("Extra Fees Calculator").Visible = xlVeryHidden
Sheets("Control").Visible = xlVeryHidden

End Sub

Something wrong here though...any suggestions what I can do to rectif
this?

TIA,

Samuel

--
Samuel
-----------------------------------------------------------------------
SamuelT's Profile: http://www.excelforum.com/member.php...fo&userid=2750
View this thread: http://www.excelforum.com/showthread.php?threadid=55259

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Open 'n' Hide

My remedy would be that you better describe what "Something wrong here
though" means.
But at a wild guess, did you match all the brackets ?

NickHK

"SamuelT" wrote in
message ...

Hi all,

I'm trying to run a piece of VB that, on opening the spreadsheet, hides
a number of worksheets and also takes the user to a predefined sheet.
Here's what I tried:

Private Sub Workbook_Open()

Sheets("User Select").Activate
Sheets("Programme(High Level)").Visible = xlVeryHidden
Sheets("Programme (2 Week)").Visible = xlVeryHidden
Sheets("Programme (Components").Visible = xlVeryHidden
Sheets("Capacity").Visible = xlVeryHidden
Sheets("Extra Fees Calculator").Visible = xlVeryHidden
Sheets("Control").Visible = xlVeryHidden

End Sub

Something wrong here though...any suggestions what I can do to rectify
this?

TIA,

SamuelT


--
SamuelT
------------------------------------------------------------------------
SamuelT's Profile:

http://www.excelforum.com/member.php...o&userid=27501
View this thread: http://www.excelforum.com/showthread...hreadid=552597



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open 'n' Hide


Hi,

Yup, all brackets are A-OK now. There was a mistake in there, but I've
rectified it and am still getting the same problem.

My remedy would be that you better describe what "Something wrong

here
though" means.

Better desciption = Run-time error '9':
Subscript out of range

Cheers,

SamuelT


--
SamuelT
------------------------------------------------------------------------
SamuelT's Profile: http://www.excelforum.com/member.php...o&userid=27501
View this thread: http://www.excelforum.com/showthread...hreadid=552597

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Open 'n' Hide

"SamuelT" wrote in
message ...
My remedy would be that you better describe what "Something wrong

here
though" means.

Better desciption = Run-time error '9':
Subscript out of range


That probably indicates a sheet name you've specified in your code that
doesn't exist. Have you double-checked the sheet names, including for
rogue/trailing/leading (multiple-)spaces?


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Open 'n' Hide

I think its the sheet names. If they dont exist in the referenced
workbook then the interpretor will break on that error. I think simpler
naming will suffice.

ikr wrote:
"SamuelT" wrote in
message ...
My remedy would be that you better describe what "Something wrong

here
though" means.

Better desciption = Run-time error '9':
Subscript out of range


That probably indicates a sheet name you've specified in your code that
doesn't exist. Have you double-checked the sheet names, including for
rogue/trailing/leading (multiple-)spaces?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Open 'n' Hide

"SamuelT" wrote in
message ...

Hi all,

I'm trying to run a piece of VB that, on opening the spreadsheet, hides
a number of worksheets and also takes the user to a predefined sheet.
Here's what I tried:

Private Sub Workbook_Open()

Sheets("User Select").Activate
Sheets("Programme(High Level)").Visible = xlVeryHidden
Sheets("Programme (2 Week)").Visible = xlVeryHidden
Sheets("Programme (Components").Visible = xlVeryHidden


shouldn't this line read:

Sheets("Programme (Components)").Visible = xlVeryHidden ???

note the extra close parenthesis after Components. It's somewhat confusing
to look at because you have parentheses in your sheet names!

Sheets("Capacity").Visible = xlVeryHidden
Sheets("Extra Fees Calculator").Visible = xlVeryHidden
Sheets("Control").Visible = xlVeryHidden

End Sub

Something wrong here though...any suggestions what I can do to rectify
this?

TIA,

SamuelT


--
SamuelT
------------------------------------------------------------------------
SamuelT's Profile:
http://www.excelforum.com/member.php...o&userid=27501
View this thread: http://www.excelforum.com/showthread...hreadid=552597



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
hide sheet on file open Hein Excel Discussion (Misc queries) 6 October 21st 08 11:00 PM
Open and Hide a workbook MBum Excel Discussion (Misc queries) 1 July 11th 06 06:47 PM
how do i hide columns in excel so no one can open them. brianb Excel Discussion (Misc queries) 2 February 5th 06 10:09 PM
open and hide choice[_2_] Excel Programming 2 November 6th 04 08:05 PM
Open with VBA - hide passwords in code? Buffyslay Excel Programming 1 June 21st 04 02:19 PM


All times are GMT +1. The time now is 04:24 PM.

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

About Us

"It's about Microsoft Excel"