ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Disable/Enable Macros through code (https://www.excelbanter.com/excel-programming/284679-disable-enable-macros-through-code.html)

ibeetb

Disable/Enable Macros through code
 
Does anyone know how I can turn off macros or turn them on in code...??

Thanks



Pikus[_2_]

Disable/Enable Macros through code
 
To what end?

-----Original Message-----
Does anyone know how I can turn off macros or turn them

on in code...??

Thanks


.


ibeetb

Disable/Enable Macros through code
 
I have a workbook that runs automatically every night at midnight - it needs
the macros for this. But during the day, when a user oipens the wrkbook, I
want macros disabled -I need to turn them off when the time is greater than
5 AM, for ex. I have the time part down....it is just the code to disable
the macros that I need
"Pikus" wrote in message
...
To what end?

-----Original Message-----
Does anyone know how I can turn off macros or turn them

on in code...??

Thanks


.




Harlan Grove

Disable/Enable Macros through code
 
"ibeetb" wrote...
I have a workbook that runs automatically every night at midnight - it
needs the macros for this. But during the day, when a user oipens the
wrkbook, I want macros disabled -I need to turn them off when the time
is greater than 5 AM, for ex. I have the time part down....it is just
the code to disable the macros that I need


Odd design. If this is a workbook in a shared directory that is opened by a
scheduled Excel process at midnight but also available for any user to open
during the day, then there's a better way to update the workbook. Use a
separate workbook to contain the macros. It'd need to open the shared
workbook and be coded so it operates on the shared workbook, but this two
workbook design would ensure that there was no code in the shared workbook
for your users to run by accident.




All times are GMT +1. The time now is 01:57 PM.

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