Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Macros - Force execution using workbook_open

I have macros running using the workbook_open functionality. Everything
works great... except when the user selects to disable the macro
functionality. Is there a was to protect my workbook to force this macro to
run when the user opens it? I know it opens up a can of worms but I do need
to have this functionality run as soon as the spreadsheet is open.

Thanks in advance

Guy Normandeau
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 29
Default Macros - Force execution using workbook_open

Disregard this question. I just found the answer.

NO!

I'll make the sheets hidden. Unhide the sheets when the macros are enabled.


Thanks to Paul B. and Scoops!

"Guy Normandeau" wrote:

I have macros running using the workbook_open functionality. Everything
works great... except when the user selects to disable the macro
functionality. Is there a was to protect my workbook to force this macro to
run when the user opens it? I know it opens up a can of worms but I do need
to have this functionality run as soon as the spreadsheet is open.

Thanks in advance

Guy Normandeau

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 964
Default Macros - Force execution using workbook_open

That would defeat the purpose of security if this were possible.

However, you might try something like, creating a new sheet that displays a
message "Macros must be enabled for this workbook to funtion properly". Then
maybe also include instructions on how to enable macros. Save the workbook
with this sheet displayed. Then, in your workbook_open event, include a
macro to hide that message sheet. That way, the user will only see the
message if macros are disabled.

You could also hide all of your other sheets by default, and have the
workbook_open event unhide them. Thus preventing people from just ignoring
the message.

HTH,
Elkar

"Guy Normandeau" wrote:

I have macros running using the workbook_open functionality. Everything
works great... except when the user selects to disable the macro
functionality. Is there a was to protect my workbook to force this macro to
run when the user opens it? I know it opens up a can of worms but I do need
to have this functionality run as soon as the spreadsheet is open.

Thanks in advance

Guy Normandeau

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,090
Default Macros - Force execution using workbook_open

You have to go at this by way of the back door. Obviously, a macro will not
do what you want if the user elects to open the file with macros disabled.
What you need to do is to build one sheet that has nothing on it but a
message saying to the user that he must open the file with macros enabled or
he will not be able to use the file.
Then you use a Before_Close event macro that does nothing more than hide
all the sheets except that one sheet with the above message, saves the file
and closes the file.
Then in your Workbook_Open macro, include code to hide the above sheet
and unhide all the others. Actually you must write that code to unhide the
other sheets first, then hide the one sheet. You will get an error if the
code tries to hide all the sheets.
This makes it so that if the user opens the file with macros disabled,
he will see nothing but that one sheet with the message. HTH Otto
"Guy Normandeau" wrote in message
...
I have macros running using the workbook_open functionality. Everything
works great... except when the user selects to disable the macro
functionality. Is there a was to protect my workbook to force this macro
to
run when the user opens it? I know it opens up a can of worms but I do
need
to have this functionality run as soon as the spreadsheet is open.

Thanks in advance

Guy Normandeau



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
Hide Macro's in Toolbar / Macro's list sparx Excel Discussion (Misc queries) 2 May 6th 06 08:53 PM
how do I run excel 4.0 macros on excel 2000 RodolfoDallas Excel Discussion (Misc queries) 1 March 12th 06 03:14 AM
How can force enable macros to be able to open my workbook? kcdonaldson Excel Discussion (Misc queries) 3 December 5th 05 06:16 PM
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM


All times are GMT +1. The time now is 02:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"