how to disable automatic query refresh in excel?

G

Guest

I am using JAVA to retrieve data to an excel sheet.
The data is generated in the excel sheet but when I open that excel sheet a
message comes saying
"queries are used to import external data into an excel sheet but harmful
queries can be used to access confidential information or write info back to
the database."
"This workbook contains queries to external data that refresh sutomatically".
Can anyone tell me how to get rid of this message?
and
how to disable automatic query refresh in excel?
 
G

Guest

In Excel: Go to the query results range, right-click anywhere within the
list, and choose "Data Range Properties." There will be settings that
control the way the data is refreshed, and you will probably see that
"Refresh data on file open" is checked. If you uncheck this and save the
workbook, it should eliminate the message since the query is not being run.
But depending on how you implemented your code, that may prevent the latest
data from being imported to the workbook unless you run the query after
opening, either manually or through code.

Programatically, you can disable the automatic refresh by setting the
RefreshOnFileOpen property of the QueryTable to False.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top