|
-
Aug 16th, 2005, 12:08 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Excel - Disabled Macros
My spreadsheet needs the macros to work correctly.
Is it possible to use the IF statement in a cell to work out if the macros are disabled or not?
I was thinking of some sort of conditional formatting that would put in big letters "Enable the macros!" if the sheet was open with the macros disabled.
-
Aug 16th, 2005, 12:27 PM
#2
Re: Excel - Disabled Macros
A simple way would be to have that in the cell by default and if macros are enabled then have a small macro to clear that cell. So if no macros are enabled it will be left in the cell so they can read it.
If not i'll look into seeing if there is anyother way.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 16th, 2005, 12:31 PM
#3
Thread Starter
Frenzied Member
Re: Excel - Disabled Macros
Backward thinking! I like it!
-
Aug 16th, 2005, 01:20 PM
#4
Re: Excel - Disabled Macros
My dyslexia is finally paying off.
I couldnt find anything that would help on this.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Aug 17th, 2005, 08:44 AM
#5
Thread Starter
Frenzied Member
Re: Excel - Disabled Macros
I created a sheet with a big message on it then
On Open I hid it and unhid the other sheets
On Close I hid the other sheets and unhid the message sheet.
That way it looks normal if you enable macros and has only a message if the macros are disabled
VB Code:
Option Explicit
Private Sub Workbook_Open()
'Make the sheets visible if the macros are enabled
Sheets(2).Visible = True
Sheets(3).Visible = True
Sheets(4).Visible = True
'Hide the disabled macro sheet
Sheets(1).Visible = False
End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
'Show the disabled macro sheet
Sheets(1).Visible = True
'Hide all the proper sheets so that a macro must open them
Sheets(2).Visible = False
Sheets(3).Visible = False
Sheets(4).Visible = False
'Save the workbook
Me.Save
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|