Acknowledging Excel Popups from VB commands

Mr Blue

New Member
Joined
Dec 12, 2005
Messages
5
I am currently trying to open an SQL database and convert it to a CSV file from and external program using VBA commands. I am able to open Excel as well as a template file that has the links to the SQL database, but then a security popup appears (stating that the file is accessing external information - is it secure) that requires an acceptance to continue the process.

My question is: is there a way to accept the popup from VB commands, or can the popup be turned off.

Thanks
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Well normally to turn off alerts you would use this.
Code:
Application.DisplayAlerts = False
But I don't know if it will work in your circumstances.
 
Upvote 0
no luck

I tried application.displayalerts = false, both in my application and also as a macro in the excel file and in both instances it didn't work.

The issue is very odd, because the pop-up is basically asking if I want to auto refresh my data. If I say enable the auto refresh it does, but the next time I open the file it asks again.

Any ideas :confused:
 
Upvote 0
What do you mean by your 'application'?
 
Upvote 0
I have 2 primary applications running. The First is an automation package that is populating an SQL database. The goal is that when certain criteria are met this automation package will open Excel which will extract the information from the SQL database and save the data to a CSV file.

So I tried the Displayalert =false command from the automation application (where the call is made to open the file) and as a macro within the excel file.

Ideally, all the commands to open and saveas a csv file would reside in the automation application and OLE commands could be used, but I can't even get VB in excel to accept or override this popup window.

Thanks again!
 
Upvote 0
But what do you mean by 'application'?

An instance of Excel, a VB project?
 
Upvote 0
Sorry I wasn't clear the first time. I updated the post while you were writing your reply.

Mr Blue said:
I have 2 primary applications running. The First is an automation package that is populating an SQL database. The goal is that when certain criteria are met this automation package will open Excel which will extract the information from the SQL database and save the data to a CSV file.

So I tried the Displayalert =false command from the automation application (where the call is made to open the file) and as a macro within the excel file.

Ideally, all the commands to open and saveas a csv file would reside in the automation application and OLE commands could be used, but I can't even get VB in excel to accept or override this popup window.

Thanks again!
 
Upvote 0
Do you have a reference to Excel at all in your code?

Which package/application/whatever is actually generating this message?
 
Upvote 0
The actual message is generated by Excel and will appear weather the template is opened by the automation application or directly by excel. Like I stated earlier the message is just asking if I want to automatically update, but even though I enable it, everytime I open the tenplate in excel I get asked teh same question.

Maybe it's better to not worry about the automation application, because if I can get excel to open the template without having the pop-up appear, the automation application should work fine as well.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top