View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default How To Check If The User Has Macros Enabled When The Workbook Opens



I'm getting a message saying 'Unable to set the visible property of
the worksheet class'. what the heck is that? I have been able to set
it with this statement before...

Sheets("Sheet4").Visible = False


A workbook must always have at least one sheet visible. If you attempt
to hide all the worksheets in a workbook, the code will blow up when
you attempt to hide the last visible sheet.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Fri, 12 Dec 2008 11:51:37 -0800 (PST),
wrote:

On Dec 12, 12:10 pm, Chip Pearson wrote:
If macros are disabled, you can't run any code that would test that.
If code runs, then, by definition, macros are enabled. If you need the
user to have macros enabled to use the workbook, you can set things up
to that the workbook is unusable if macros are disabled. Seehttp://www.cpearson.com/Excel/EnableMacros.aspx
andhttp://www.cpearson.com/Excel/EnableMacros2.aspx

for details and examples.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLCwww.cpearson.com
(email on web site)

On Fri, 12 Dec 2008 10:12:55 -0800 (PST),

wrote:
Hi,


I have a workbook project which I will be distributing to a bunch of
execs and I want to write a select case statement to check and see
whether the user has macros enabled when he opens it. What is the
object/method for macros or security or whatever?


Thanks


I'm getting a message saying 'Unable to set the visible property of
the worksheet class'. what the heck is that? I have been able to set
it with this statement before...

Sheets("Sheet4").Visible = False