Workbooks.Open doesn't cause the Enable macro's pop-up. At least, it hasn't done that for over two decades.
Workbooks.Open doesn't cause the Enable macro's pop-up. At least, it hasn't done that for over two decades.
No, I think I would need your full Excel project (and accompanying files) to troubleshoot this, not just some VBA code.
You need to find out what exactly causes the file to open and trigger the macro warning dialog. Anything goes for that matter, Autohotkey?
I replicated my files and attached them! But with this file, the problem does not appear!!! The only differences between those files are the complexity. The original Excel file i sadly cannot share has 30 worksheets and 5MB (like the PPT). Everythink else it the same. I dont use autohotkey.
I filmed it so you see where the security window appears. Here is the video (too big to attach it): https://drive.google.com/file/d/1HGV...ew?usp=sharing
Last edited by o0omax; 08-16-2022 at 01:45 PM.
What happens if you change the .Open line to this:
Dim autom As Long autom = Application.AutomationSecurity Application.AutomationSecurity = msoAutomationSecurityForceDisable Set wb = Workbooks.Open(folderName & "\" & DateiName & ".xlsm") Application.AutomationSecurity = autom
@JKP, Are all "Application.( what ever)" declared as Long's?
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
I tested it and one out of two files (1st one) which have been created did not close.
Occasionaly it works and all get closed. Most of the times the macro security pops up somewhere after the .Open command (e.g. when pasting to PowerPoint).
What i dont undetstand: Why does it work with the file i provided you but not with my original file, when the code is identical?
Not by definition. But most (if not all) are simple enumerations which are fine to declare as long and I was too lazy to go and search for the name of the "group of options" belonging to that particular setting so I could declare "dim autom as msoAutomationSecurity".
If you run ?typename(msoAutomationSecurityLow) in the immediate window it says Long.
I don't know why it doesn't work with your original. Have you tried cleaning the VBA project? http://www.appspro.com/Utilities/CodeCleaner.htm