LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Open Event Code Bug

Hello,
I have a problem with the code below.

I am trying to 'very hide' all sheets except the "Enable Macro"
warning sheet upon closing my workbook.
When opening the workbook and if the user disabled macros I want them
to see only the warning sheet.
If the user enabled macros upon opening I want them the see all of the
sheets except:
Enable Macro Sheet
Other sheets I set as very hidden (see code upon open)
The sheets i set as very hidden will depend on the cell value
contained on the sheet "Data Input"
This data input sheet returns the Value TRUE or FALSE (ranges C3:C21)
for the workbook sheets.

The problem I face is that my code is wrong somewhere, I can;t even
close my workbook without a code area.

Any assistance you guru's could offer me would be greatly appreciated.

Thanks
Tim

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Sheets("Enable Macro").Visible = True
Sheets("Cover").Visible = xlSheetVeryHidden
Sheets("Key Assumptions").Visible = xlSheetVeryHidden
Sheets("Notes").Visible = xlSheetVeryHidden
Sheets("FF&E Master").Visible = xlSheetVeryHidden
Sheets("Area Analisys").Visible = xlSheetVeryHidden
Sheets("FF&E Price Input").Visible = xlSheetVeryHidden
Sheets("Construction Costs").Visible = xlSheetVeryHidden
Sheets("Depreciation").Visible = xlSheetVeryHidden
Sheets("OE & Uniform").Visible = xlSheetVeryHidden
Sheets("Payroll").Visible = xlSheetVeryHidden
Sheets("P&L year 1").Visible = xlSheetVeryHidden
Sheets("P&L year 1-5").Visible = xlSheetVeryHidden
Sheets("Breakeven").Visible = xlSheetVeryHidden
Sheets("Cashflow").Visible = xlSheetVeryHidden
Sheets("Data Sensitization").Visible = xlSheetVeryHidden
Sheets("Executive Summary").Visible = xlSheetVeryHidden
Sheets("Data Input").Visible = xlSheetVeryHidden
Sheets("Calculations").Visible = xlSheetVeryHidden
End Sub

Private Sub Workbook_Open()
Sheets("Enable Macro").Visible = Range("Data Input C3")
Sheets("Cover").Visible = Range("Data Input C4")
Sheets("Key Assumptions").Visible = Range("Data Input C5")
Sheets("Notes").Visible = Range("Data Input C6")
Sheets("FF&E Master").Visible = Range("Data Input C7")
Sheets("Area Analisys").Visible = Range("Data Input C8")
Sheets("FF&E Price Input").Visible = Range("Data Input C9")
Sheets("Construction Costs").Visible = Range("Data Input C10")
Sheets("Depreciation").Visible = Range("Data Input C11")
Sheets("OE & Uniform").Visible = Range("Data Input C12")
Sheets("Payroll").Visible = Range("Data Input C13")
Sheets("P&L year 1").Visible = Range("Data Input C14")
Sheets("P&L year 1-5").Visible = Range("Data Input C15")
Sheets("Breakeven").Visible = Range("Data Input C16")
Sheets("Cashflow").Visible = Range("Data Input C17")
Sheets("Data Sensitization").Visible = Range("Data Input C18")
Sheets("Executive Summary").Visible = Range("Data Input C19")
Sheets("Data Input").Visible = Range("Data Input C20")
Sheets("Calculations").Visible = Range("Data Input C21")
Splash.Show

End Sub
 
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
Which 'event' to run pivot chart formatting code on file open? David Charts and Charting in Excel 1 June 11th 09 02:22 PM
What code do I use to attach event handler that will open my user. TeresaManley Excel Worksheet Functions 2 May 5th 07 09:55 PM
Worksheet Event Code chequer - ExcelForums.com Excel Worksheet Functions 0 November 10th 04 06:30 AM
help worksheet event code scott23 Excel Programming 2 January 6th 04 08:17 PM
Add event code through a macro Hans Bergman Excel Programming 1 October 31st 03 07:04 PM


All times are GMT +1. The time now is 09:40 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"