Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If macros aren't enabled, then no macro will run -- including the macro that
would check to see if macros are enabled. 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 -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There is none per se, but you can do something like this
The standard way to approach this is as follows. - create a worksheet with a message on explaining that for this workbook to run it needs macros enabled, maybe even a few screenshots - hide all other worksheets - add some code in the Workbook_Open event that un hides the other sheets, but hides that sheet. What happens is that if they do not enable macros, they will only see the warning sheet, telling them how to do it. If they enable macros,it will start-up the workbook as it should be. -- __________________________________ HTH Bob wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You can't use code to check if a user has macros enabled, it won't run! Most methods use hide all pages except a warning page on closing. When the workbook is opened this page will be visible if macros are not enabled. If macros are enabled code in the open event unhides the other pages & hdes the warning See 'Excel Help: How to make a user enable Excel macros' (http://tinyurl.com/5n4yyd) -- royUK Hope that helps, RoyUK For tips & examples visit my 'web site' (http://www.excel-it.com/) ------------------------------------------------------------------------ royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=40314 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. See http://www.cpearson.com/Excel/EnableMacros.aspx and http://www.cpearson.com/Excel/EnableMacros2.aspx for details and examples. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 Perfect. Thanks for all of your answers. Very Helpful. |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can Add-in determine if macros enabled in another workbook? | Excel Programming | |||
Closing a Workbook if Macros aren't enabled. | Excel Programming | |||
how to track changes in a workbook with macros enabled | Excel Discussion (Misc queries) | |||
Close Workbook if Macros not enabled | Excel Programming | |||
Open workbook-macros enabled, opening another with macros | Excel Programming |