TotallyConfused
Board Regular
- Joined
- May 4, 2017
- Messages
- 247
- Office Version
- 365
- Platform
- Windows
Hello
I have a series of programs I've written and each one contains one or more VBA macros. Normally for protection, Excel is set NOT to allow any macros, but now I need to change those settings temporarily. My thinking is that I’d disable the setting not allowing any macros, at the beginning of each program, then reset them at the program’s end. The computer is able to go online; however, all of the programs are on its hard drive. We’re not accessing any websites or anything, so I’d think we’d be safe enough.
My idea may be good; however, being a relative newcomer to Excel/VBA, I know my programming skills are not so good. I’ve learned how to manually disable that security setting by ‘Alt L’ then typing ‘A S’, which causes a ‘Trust Center’ screen to pop up, allowing me to select one of four options. I’d prefer not to make the user go through that process. The following macro seems to accept the ‘Alt L’ part, at least I think it is, but then it stops and won’t accept anything else.
I’ve tried various combinations of that single line of code, ranging from combining everything in one line, to several lines of SendKeys. If anyone has any suggestions on how I can temporarily disable that safety restriction I’d sure love to hear them?
It’s my understanding that once I’m able to access that ‘pop-up’ screen, then I need to switch to Ctrl (which is ‘^’) ‘then the underlined letter’. Is this correct? Perhaps there is a better way to over-ride that restriction then the way I’m attempting, if so, I’d appreciate hearing it.
THANK YOU in advance for any help you may be able to offer.
TotallyConfused
I have a series of programs I've written and each one contains one or more VBA macros. Normally for protection, Excel is set NOT to allow any macros, but now I need to change those settings temporarily. My thinking is that I’d disable the setting not allowing any macros, at the beginning of each program, then reset them at the program’s end. The computer is able to go online; however, all of the programs are on its hard drive. We’re not accessing any websites or anything, so I’d think we’d be safe enough.
My idea may be good; however, being a relative newcomer to Excel/VBA, I know my programming skills are not so good. I’ve learned how to manually disable that security setting by ‘Alt L’ then typing ‘A S’, which causes a ‘Trust Center’ screen to pop up, allowing me to select one of four options. I’d prefer not to make the user go through that process. The following macro seems to accept the ‘Alt L’ part, at least I think it is, but then it stops and won’t accept anything else.
Code:
Sub EnableAllMacros()
SendKeys "%{L}", True
‘ At this point, everything comes to a halt.
End Sub
I’ve tried various combinations of that single line of code, ranging from combining everything in one line, to several lines of SendKeys. If anyone has any suggestions on how I can temporarily disable that safety restriction I’d sure love to hear them?
It’s my understanding that once I’m able to access that ‘pop-up’ screen, then I need to switch to Ctrl (which is ‘^’) ‘then the underlined letter’. Is this correct? Perhaps there is a better way to over-ride that restriction then the way I’m attempting, if so, I’d appreciate hearing it.
THANK YOU in advance for any help you may be able to offer.
TotallyConfused