Testing, in VB, if the macro security has been set to high ?

Angelo Dundee

Board Regular
Joined
Nov 18, 2002
Messages
167
1) Can someone do a test in visual basic to check whether the macro
security has been set to high ?
e.g. If the security is high, then the program should issue the following
warning, when starting :-
'The program will not open because your macro security has been set to
high'
'Change the macro security to medium, and re-open the program'

2) Can someone do a test in visual basic to check whether the user has
disabled the macro's ( on entry ) ?
e.g. If the macro's have been disabled, then the program should issue the
following warning, when starting :-
'The program will not open because you have disabled the macro's'
'Re-start the program, and enable the macro's, or else the program will not
open'
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
re :-

Thanks Andrew, however :-

The warning sheet has been made visible and all other sheets have been
hidden on the previous close of the program.

The problem with this is that :-

After the user presses enable macro's the warning sheet will become
visible, and stay visible, untill the Workbook_Open VB has finished
initialising.
If the Workbook_Open macro is big, then the warning sheet may stay
visible for quite some time.
Obviously this is not neat programing !

Can anybody suggest a solution to this ?
 
Upvote 0
It might not be neat but it is sadly the best and safest way to handle this. You can do it but the method used is not a wise one to take I and just about everyone else will agree on that. If you where to use a VB launch program for your spreadsheet you could look at their registry settings and see what the marco sercurity is. Then you could prompt your message before opening the spread sheet.
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,479
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top