Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How To Check If The User Has Macros Enabled When The Workbook Opens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How To Check If The User Has Macros Enabled When The Workbook Opens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default How To Check If The User Has Macros Enabled When The Workbook Opens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How To Check If The User Has Macros Enabled When The Workbook Opens


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default How To Check If The User Has Macros Enabled When The Workbook Opens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How To Check If The User Has Macros Enabled When The WorkbookOpens

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default How To Check If The User Has Macros Enabled When The WorkbookOpens

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
  #8   Report Post  
Posted to microsoft.public.excel.programming
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

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
Can Add-in determine if macros enabled in another workbook? Anthony Berglas Excel Programming 4 November 30th 08 08:45 AM
Closing a Workbook if Macros aren't enabled. [email protected] Excel Programming 3 August 9th 07 08:00 PM
how to track changes in a workbook with macros enabled Jerjuice Excel Discussion (Misc queries) 0 October 11th 06 06:15 PM
Close Workbook if Macros not enabled Graham Fowler Excel Programming 2 September 23rd 05 11:06 PM
Open workbook-macros enabled, opening another with macros George J Excel Programming 5 September 17th 04 02:07 PM


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