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


Hi

I have workbook that needs macros to be enabled i have found a thread
see link below that displays a splash screen if macros are disabled BUT
the code hides all the sheets and shows only the splash screen the
problem i have is i have about 30 odd sheets that are hidden all the
time and about 10 that are visable, how would are alter the code to
suit my needs


http://www.excelforum.com/showthread...ableing+macros

Thanks


--
raw
------------------------------------------------------------------------
raw's Profile: http://www.excelforum.com/member.php...o&userid=28312
View this thread: http://www.excelforum.com/showthread...hreadid=493326

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Enabled macros

You could try this approach. Your sheets that you want permanently hidden,
set them as xlSheetVeryHidden. Then add this code, which incidentally, also
reverts things at the end

Option Explicit

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Sheets("Splash").Visible = xlSheetVisible
For Each sh In Sheets
If sh.Name < "Splash" Then
If sh.Visible = xlSheetVisible Then
sh.Visible = xlSheetHidden
End If
End If
Next sh
thisworkbbok.Save
End Sub

Private Sub Workbook_Open()
Dim sh As Object
For Each sh In Sheets
If sh.Visible < xlSheetVeryHidden Then
sh.Visible = True
End If
Next sh
Sheets("Splash").Visible = xlSheetVeryHidden
End Sub


'This is workbook event code.
'To input this code, right click on the Excel icon on the worksheet
'(or next to the File menu if you maximise your workbooks),
'select View Code from the menu, and paste the code


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"raw" wrote in message
...

Hi

I have workbook that needs macros to be enabled i have found a thread
see link below that displays a splash screen if macros are disabled BUT
the code hides all the sheets and shows only the splash screen the
problem i have is i have about 30 odd sheets that are hidden all the
time and about 10 that are visable, how would are alter the code to
suit my needs



http://www.excelforum.com/showthread...ableing+macros

Thanks


--
raw
------------------------------------------------------------------------
raw's Profile:

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



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
How do I keep a file from opening unless macros are enabled? sharken Excel Discussion (Misc queries) 1 August 28th 09 12:02 AM
how to track changes in a workbook with macros enabled Jerjuice Excel Discussion (Misc queries) 0 October 11th 06 06:15 PM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM
How to have macros enabled at start Bill D.[_2_] Excel Programming 3 April 16th 04 12:16 AM
Fail if macros are not enabled? JonF Excel Programming 1 October 23rd 03 05:10 PM


All times are GMT +1. The time now is 01:32 AM.

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"