Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refreshing Querytables in Excel

Status
Not open for further replies.

Mon

ISP
Jul 22, 1999
2
0
0
IE
www.mfcomputerservices.ie
Hi<br>
<br>
Can anyone help? In Excel I am using VB code to Refresh a query table to an Access Database. However, Excel will not redraw the spreadsheet with the external data unless I come out of the procedure. I need to do other things in this procedure after it gets the data. I am using the Activesheet.Querytables.Add method. All tips welcome!<br>
<br>
Thank you in advance<br>
<p>Monica<br><a href=mailto:flood@indigo.ie>flood@indigo.ie</a><br><a href= Computer Services</a><br>
 
Sorry, no tips cause my refresh macro fine. Do you mean that you need two separate codes to first retrieve data and then manipulate it?<br>
<br>
I take data from SQL Server through ODBC-driver. My code (recorded) is like this: <br>
With ActiveSheet.QueryTables.Add(Connection......<br>
....<br>
.FieldNames = True<br>
.RefreshStyle = xlInsertDeleteCells<br>
.RowNumbers = False<br>
.FillAdjacentFormulas = False<br>
.RefreshOnFileOpen = False<br>
.HasAutoFormat = True<br>
.BackgroundQuery = True<br>
.TablesOnlyFromHTML = True<br>
.Refresh BackgroundQuery:=False<br>
.SavePassword = True<br>
.SaveData = True<br>
End With<br>
<br>
...and same macro continues...<br>
<br>
Good luck,<br>
Al
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top