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
 

Some videos you may like

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
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.
 

Mr Blue

New Member
Joined
Dec 12, 2005
Messages
5
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:
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
What do you mean by your 'application'?
 

Mr Blue

New Member
Joined
Dec 12, 2005
Messages
5

ADVERTISEMENT

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!
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
But what do you mean by 'application'?

An instance of Excel, a VB project?
 

Mr Blue

New Member
Joined
Dec 12, 2005
Messages
5

ADVERTISEMENT

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!
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,061
Office Version
  1. 365
Platform
  1. Windows
Do you have a reference to Excel at all in your code?

Which package/application/whatever is actually generating this message?
 

Mr Blue

New Member
Joined
Dec 12, 2005
Messages
5
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,118,799
Messages
5,574,387
Members
412,590
Latest member
Velly
Top