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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,351
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,351
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,351
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,351
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,835
Messages
5,855,910
Members
431,772
Latest member
dannyboi1

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
Top