PC Review


Reply
Thread Tools Rate Thread

DisplayAlerts and QueryTable issues

 
 
=?Utf-8?B?Sm9obiBLZWl0aA==?=
Guest
Posts: n/a
 
      25th Jan 2007

Application.DisplayAlerts = False
Sheets("SiteData").Select
Selection.QueryTable.Refresh BackgroundQuery:=False

the Query was created manually by going through the menu drop downs and
selecting the file, then seperating the data into proper columns.

When executing this code from an Auto_Open the dialog boxes still popup.
The Default info is already properly set in the connection string. How do I
prevent these pesky dialog boxes from interrupting the flow?

From the "Refresh" method's help screens...
After Microsoft Excel makes a successful connection, it stores the completed
connection string so that prompts won't be displayed for subsequent calls to
the Refresh method during the same editing session. You can obtain the
completed connection string by examining the value of the Connection property.

It seems that since I am calling the .refresh upon initial loading of the
spreadsheet this qualifies as the first successful connection for this edit
session.

How do i force the refresh to use all the defaults?


--
Regards,
John
 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9obiBLZWl0aA==?=
Guest
Posts: n/a
 
      25th Jan 2007
I think I found the answer....
When creating the query, at the point where you specify where to insert the
data; there is an advanced button, and inside is a setting that defaults to
"prompt for filename on Refresh" I unchecked this box and now the refresh
method called from auto_open uses the defaults.

I also that I could set the refresh to automatic on workbook open. but in
my case I did not want that to happen because the Auto_Open, prior to needing
a querytable.refresh has a choice to download via FTP from a mainframe that
is not yet allowing XML calls to get it's data. So If I dont FTP, then there
is no need to refresh the query table.


--
Regards,
John


"John Keith" wrote:

>
> Application.DisplayAlerts = False
> Sheets("SiteData").Select
> Selection.QueryTable.Refresh BackgroundQuery:=False
>
> the Query was created manually by going through the menu drop downs and
> selecting the file, then seperating the data into proper columns.
>
> When executing this code from an Auto_Open the dialog boxes still popup.
> The Default info is already properly set in the connection string. How do I
> prevent these pesky dialog boxes from interrupting the flow?
>
> From the "Refresh" method's help screens...
> After Microsoft Excel makes a successful connection, it stores the completed
> connection string so that prompts won't be displayed for subsequent calls to
> the Refresh method during the same editing session. You can obtain the
> completed connection string by examining the value of the Connection property.
>
> It seems that since I am calling the .refresh upon initial loading of the
> spreadsheet this qualifies as the first successful connection for this edit
> session.
>
> How do i force the refresh to use all the defaults?
>
>
> --
> Regards,
> John

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
what besides displayalerts statement Sarah Microsoft Excel Programming 2 17th May 2010 02:28 PM
DisplayAlerts =?Utf-8?B?R2FyeScncyBTdHVkZW50?= Microsoft Excel Programming 0 9th Apr 2007 06:40 PM
DisplayAlerts (Which Ones?) =?Utf-8?B?S2xhdHV1?= Microsoft Excel Programming 2 30th Jun 2005 02:09 PM
DisplayAlerts Howard Kaikow Microsoft Excel Programming 12 29th Apr 2005 04:24 PM
Re: Can't Set DisplayAlerts to False Mark Driscol Microsoft Excel Programming 1 6th Apr 2004 10:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:18 AM.