ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Test for Disable / Enable Macros (https://www.excelbanter.com/excel-programming/387984-test-disable-enable-macros.html)

Neal Zimm

Test for Disable / Enable Macros
 
I'm building an App where code in the Wbk Open event must execute.
I can't find where/how to test if the user has clicked the disable macro
button when Excel presents that choice. (Note: I have a "gateway" Sub in the
works that will execute before every user-selected macro to be the likely
home for this code.)

Further note: the open event calls a macro located in an add-in.

1) example please or point me in the right direction?

2) I know the 'danger', but does Exel allow you to disable the dis/enable
dialog box in favor of forcing "Enable Macros". and if so, how?

Thanks much,
Neal Z


--
Neal Z

Jim Thomlinson

Test for Disable / Enable Macros
 
There is no effective way to circumvent the Macro Security. The problem you
are going to run into is that if the macros are disabled then NO code runs
and you can not use code to check anything. The most effective work around is
to ensure that all of the sheets are very hidden (done with befroe close
code) with the exception of a security sheet that tells the user that macros
must be enabled to use the book. If macros are enabled then use code to
unhide the appropriate sheets and hide the security page.
--
HTH...

Jim Thomlinson


"Neal Zimm" wrote:

I'm building an App where code in the Wbk Open event must execute.
I can't find where/how to test if the user has clicked the disable macro
button when Excel presents that choice. (Note: I have a "gateway" Sub in the
works that will execute before every user-selected macro to be the likely
home for this code.)

Further note: the open event calls a macro located in an add-in.

1) example please or point me in the right direction?

2) I know the 'danger', but does Exel allow you to disable the dis/enable
dialog box in favor of forcing "Enable Macros". and if so, how?

Thanks much,
Neal Z


--
Neal Z


Halim

Test for Disable / Enable Macros
 
Hi,

I think Jim was right but I've tried by using registry file or changing
Excel's security via *.reg that opened before execute Excel file.

You can change the security you like... but ensure that registry contents
correct Address of setting you want to change (Excel Security), that depend
on you Excel version... ...
--

Regards,

Halim


"Neal Zimm" wrote:

I'm building an App where code in the Wbk Open event must execute.
I can't find where/how to test if the user has clicked the disable macro
button when Excel presents that choice. (Note: I have a "gateway" Sub in the
works that will execute before every user-selected macro to be the likely
home for this code.)

Further note: the open event calls a macro located in an add-in.

1) example please or point me in the right direction?

2) I know the 'danger', but does Exel allow you to disable the dis/enable
dialog box in favor of forcing "Enable Macros". and if so, how?

Thanks much,
Neal Z


--
Neal Z


NickHK

Test for Disable / Enable Macros
 
If I found your code attempting to change my security setting, I would
instantly delete all your products.
If you cannot operate within the user's environment, inform the user of the
limitation/situation and exit.
Unless of course you wish to get a name as a virus writer.

NickHK

"Halim" wrote in message
...
Hi,

I think Jim was right but I've tried by using registry file or changing
Excel's security via *.reg that opened before execute Excel file.

You can change the security you like... but ensure that registry contents
correct Address of setting you want to change (Excel Security), that

depend
on you Excel version... ...
--

Regards,

Halim


"Neal Zimm" wrote:

I'm building an App where code in the Wbk Open event must execute.
I can't find where/how to test if the user has clicked the disable macro
button when Excel presents that choice. (Note: I have a "gateway" Sub

in the
works that will execute before every user-selected macro to be the

likely
home for this code.)

Further note: the open event calls a macro located in an add-in.

1) example please or point me in the right direction?

2) I know the 'danger', but does Exel allow you to disable the

dis/enable
dialog box in favor of forcing "Enable Macros". and if so, how?

Thanks much,
Neal Z


--
Neal Z




Neal Zimm

Test for Disable / Enable Macros
 
Thanks, i have very hidden sheets already and will try to incorporate what i
need into them.
--
Neal Z


"Jim Thomlinson" wrote:

There is no effective way to circumvent the Macro Security. The problem you
are going to run into is that if the macros are disabled then NO code runs
and you can not use code to check anything. The most effective work around is
to ensure that all of the sheets are very hidden (done with befroe close
code) with the exception of a security sheet that tells the user that macros
must be enabled to use the book. If macros are enabled then use code to
unhide the appropriate sheets and hide the security page.
--
HTH...

Jim Thomlinson


"Neal Zimm" wrote:

I'm building an App where code in the Wbk Open event must execute.
I can't find where/how to test if the user has clicked the disable macro
button when Excel presents that choice. (Note: I have a "gateway" Sub in the
works that will execute before every user-selected macro to be the likely
home for this code.)

Further note: the open event calls a macro located in an add-in.

1) example please or point me in the right direction?

2) I know the 'danger', but does Exel allow you to disable the dis/enable
dialog box in favor of forcing "Enable Macros". and if so, how?

Thanks much,
Neal Z


--
Neal Z


Neal Zimm

Test for Disable / Enable Macros
 
Thanks, but i really don't fool with the registry yet. I'll find a workaround.
--
Neal Z


"Halim" wrote:

Hi,

I think Jim was right but I've tried by using registry file or changing
Excel's security via *.reg that opened before execute Excel file.

You can change the security you like... but ensure that registry contents
correct Address of setting you want to change (Excel Security), that depend
on you Excel version... ...
--

Regards,

Halim


"Neal Zimm" wrote:

I'm building an App where code in the Wbk Open event must execute.
I can't find where/how to test if the user has clicked the disable macro
button when Excel presents that choice. (Note: I have a "gateway" Sub in the
works that will execute before every user-selected macro to be the likely
home for this code.)

Further note: the open event calls a macro located in an add-in.

1) example please or point me in the right direction?

2) I know the 'danger', but does Exel allow you to disable the dis/enable
dialog box in favor of forcing "Enable Macros". and if so, how?

Thanks much,
Neal Z


--
Neal Z


Halim

Test for Disable / Enable Macros
 
Sorry Nick...

I'm not attempting to harm other people application, I only try to share...
:D
--

Regards,

Halim


"NickHK" wrote:

If I found your code attempting to change my security setting, I would
instantly delete all your products.
If you cannot operate within the user's environment, inform the user of the
limitation/situation and exit.
Unless of course you wish to get a name as a virus writer.

NickHK

"Halim" wrote in message
...
Hi,

I think Jim was right but I've tried by using registry file or changing
Excel's security via *.reg that opened before execute Excel file.

You can change the security you like... but ensure that registry contents
correct Address of setting you want to change (Excel Security), that

depend
on you Excel version... ...
--

Regards,

Halim


"Neal Zimm" wrote:

I'm building an App where code in the Wbk Open event must execute.
I can't find where/how to test if the user has clicked the disable macro
button when Excel presents that choice. (Note: I have a "gateway" Sub

in the
works that will execute before every user-selected macro to be the

likely
home for this code.)

Further note: the open event calls a macro located in an add-in.

1) example please or point me in the right direction?

2) I know the 'danger', but does Exel allow you to disable the

dis/enable
dialog box in favor of forcing "Enable Macros". and if so, how?

Thanks much,
Neal Z


--
Neal Z





Neal Zimm

Test for Disable / Enable Macros
 
Thanks, kinda new @ this and didn't that of that aspect. Very sensible.
Thanks again.
--
Neal Z


"NickHK" wrote:

If I found your code attempting to change my security setting, I would
instantly delete all your products.
If you cannot operate within the user's environment, inform the user of the
limitation/situation and exit.
Unless of course you wish to get a name as a virus writer.

NickHK

"Halim" wrote in message
...
Hi,

I think Jim was right but I've tried by using registry file or changing
Excel's security via *.reg that opened before execute Excel file.

You can change the security you like... but ensure that registry contents
correct Address of setting you want to change (Excel Security), that

depend
on you Excel version... ...
--

Regards,

Halim


"Neal Zimm" wrote:

I'm building an App where code in the Wbk Open event must execute.
I can't find where/how to test if the user has clicked the disable macro
button when Excel presents that choice. (Note: I have a "gateway" Sub

in the
works that will execute before every user-selected macro to be the

likely
home for this code.)

Further note: the open event calls a macro located in an add-in.

1) example please or point me in the right direction?

2) I know the 'danger', but does Exel allow you to disable the

dis/enable
dialog box in favor of forcing "Enable Macros". and if so, how?

Thanks much,
Neal Z


--
Neal Z





NickHK

Test for Disable / Enable Macros
 
Nothing personal, just I would not advise that as a good approach..

NickHK

"Halim" wrote in message
...
Sorry Nick...

I'm not attempting to harm other people application, I only try to

share...
:D
--

Regards,

Halim


"NickHK" wrote:

If I found your code attempting to change my security setting, I would
instantly delete all your products.
If you cannot operate within the user's environment, inform the user of

the
limitation/situation and exit.
Unless of course you wish to get a name as a virus writer.

NickHK

"Halim" wrote in message
...
Hi,

I think Jim was right but I've tried by using registry file or

changing
Excel's security via *.reg that opened before execute Excel file.

You can change the security you like... but ensure that registry

contents
correct Address of setting you want to change (Excel Security), that

depend
on you Excel version... ...
--

Regards,

Halim


"Neal Zimm" wrote:

I'm building an App where code in the Wbk Open event must execute.
I can't find where/how to test if the user has clicked the disable

macro
button when Excel presents that choice. (Note: I have a "gateway"

Sub
in the
works that will execute before every user-selected macro to be the

likely
home for this code.)

Further note: the open event calls a macro located in an add-in.

1) example please or point me in the right direction?

2) I know the 'danger', but does Exel allow you to disable the

dis/enable
dialog box in favor of forcing "Enable Macros". and if so, how?

Thanks much,
Neal Z


--
Neal Z








All times are GMT +1. The time now is 07:37 PM.

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