ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pre-Open VBA (https://www.excelbanter.com/excel-programming/364344-pre-open-vba.html)

SamuelT[_21_]

Pre-Open VBA
 

Hi all,

I've got a spreadsheet that has a number of macros that are essential
to the running of the document. However, I've noticed that when some
people use the document they're are opting to not run macros when
questioned on opening the file.

Is there a means of either a) having a window saying something like
'You must run macros to use this spreadsheet' that comes up before the
Excel 'run macros' prompt; or b) run the macros automatically and do
away with the pre-open prompt.

Any suggestions appreciated.

TIA,

SamuelT


--
SamuelT
------------------------------------------------------------------------
SamuelT's Profile: http://www.excelforum.com/member.php...o&userid=27501
View this thread: http://www.excelforum.com/showthread...hreadid=552165


NickHK

Pre-Open VBA
 
Samuel,
The general concept is to set all WS's xlVeryHidden, except one that has a
message that says "Macros must be enabled to use this WB."
And you have WB_Open code that hides that splash screen and shows the
required sheets.
Consequently, if macros are disabled, this WB_Open code cannot run and the
user is left viewing your "Macros must be enabled ....
Don't a matching WB_BeforeSave code to reverse these changes.

NickHK

"SamuelT" wrote in
message ...

Hi all,

I've got a spreadsheet that has a number of macros that are essential
to the running of the document. However, I've noticed that when some
people use the document they're are opting to not run macros when
questioned on opening the file.

Is there a means of either a) having a window saying something like
'You must run macros to use this spreadsheet' that comes up before the
Excel 'run macros' prompt; or b) run the macros automatically and do
away with the pre-open prompt.

Any suggestions appreciated.

TIA,

SamuelT


--
SamuelT
------------------------------------------------------------------------
SamuelT's Profile:

http://www.excelforum.com/member.php...o&userid=27501
View this thread: http://www.excelforum.com/showthread...hreadid=552165




[email protected]

Pre-Open VBA
 
You cannot get round the macro security (otherwise it would be
pointless it being there) but you CAN stop people doing anything
without the macros - I would have ONE visible sheet which had a large
note on it about the macros. I would have the rest of the sheets set
to VERY HIDDEN and have the open event of the workbook unhide/hide the
appropriate sheets - with the close event of the workbook doing the
opposite.

SamuelT wrote:
Hi all,

I've got a spreadsheet that has a number of macros that are essential
to the running of the document. However, I've noticed that when some
people use the document they're are opting to not run macros when
questioned on opening the file.

Is there a means of either a) having a window saying something like
'You must run macros to use this spreadsheet' that comes up before the
Excel 'run macros' prompt; or b) run the macros automatically and do
away with the pre-open prompt.

Any suggestions appreciated.

TIA,

SamuelT


--
SamuelT
------------------------------------------------------------------------
SamuelT's Profile: http://www.excelforum.com/member.php...o&userid=27501
View this thread: http://www.excelforum.com/showthread...hreadid=552165




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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com