Other than changing settings in Options>Trust Center>Trust Center Settings is it possible to click on the "Enable Content" button using VBA?
VBA Solution External Data Connection Prompt
-
- GoldLounger
- Posts: 2618
- Joined: 26 Jan 2010, 16:31
- Location: Southern California
VBA Solution External Data Connection Prompt
You do not have the required permissions to view the files attached to this post.
Regards,
John
John
-
- 5StarLounger
- Posts: 964
- Joined: 08 Nov 2012, 17:54
Re: VBA Solution External Data Connection Prompt
Yes... but it's not simple.
It may be possible that you could use sendkeys... I'm not sure.
What I do to press a button on a dialog box is spawn a new instance of the application and write code to it's vbe that looks through all the windows till it finds the one with the button header and then use sendmessage to press the button.
You can't use sendmessage from the same instance you're running because the application is waiting for you to press Enable Content or whatever.
Lisa
It may be possible that you could use sendkeys... I'm not sure.
What I do to press a button on a dialog box is spawn a new instance of the application and write code to it's vbe that looks through all the windows till it finds the one with the button header and then use sendmessage to press the button.
You can't use sendmessage from the same instance you're running because the application is waiting for you to press Enable Content or whatever.
Lisa
-
- GoldLounger
- Posts: 2618
- Joined: 26 Jan 2010, 16:31
- Location: Southern California
Re: VBA Solution External Data Connection Prompt
Thanks Lisa!
I had tried using the Macro recorder from a different workbook but it did not record code other than changing to the workbook which required the "Enable Content" button.
I had tried using the Macro recorder from a different workbook but it did not record code other than changing to the workbook which required the "Enable Content" button.
Regards,
John
John
-
- 5StarLounger
- Posts: 964
- Joined: 08 Nov 2012, 17:54
Re: VBA Solution External Data Connection Prompt
Ahhhh... I just reread the question and my previous answer doesn't really apply I think. If macros are not enabled then nothing can be run! bottom!
A way around this is to open the file from a different program/instance.
Many apologies.
Lisa
A way around this is to open the file from a different program/instance.
Many apologies.
Lisa