Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
I am attempting to use the below code to run some web queries via my macro. I am often times getting an Application defined or Object defined error on the .Refresh BackgroundQuery part. I have about 5 of these queries in my macro and the error can happen in any of them and there does not appear to be a pattern. I dont know if the program is having problems connecting to the online information or what might be causing this, but I have had multiple web queries run through a macro and have never received this error. I tried tossing some Application.wait code in there but that did not seem to help. Does anyone have any suggestions on this? Also, as I run this macro over and over (I need to run it each day to gather data) "ExternalData_x" items are being created with respect to these web queries. To explain this further you can see this under the Insert - Name - Define menu. I can delete these manually but would prefer that they arent saved at all in the spreadsheet if this is at all detrimental. I have the macro deleting the QueryTables with Selection.QueryTable.Delete, but these ExternalData_x. Any suggestions on this? Thanks Matt With Sheets("RawData").QueryTables.Add(Connection:="URL ;" & url, _ Destination:=Sheets("RawData").Range("b2")) .BackgroundQuery = True .TablesOnlyFromHTML = False .Refresh BackgroundQuery:=False .SaveData = False End With |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Dynamic pivot table linked to dynamic excel spreadsheets | Excel Worksheet Functions | |||
Dynamic chart pasted to a new workbook in report can't be dynamic | Charts and Charting in Excel | |||
Help with copying dynamic column selected based on remote cell value and dynamic formula fill | Charts and Charting in Excel | |||
Dynamic Range with unused formula messing up x axis on dynamic graph | Charts and Charting in Excel | |||
Dynamic Web Queries | Excel Programming |