I have several web queries that get data from yahoo finance and google finance. It generates the following Error:
Run Time Error 1004
the file could not be accessed. Try one of the following:
-Make sure the folder exists
-Make sure the file isn't read only
-Make sure no < > | [and other special characters] are in the filename
-Make sure the file path is less than 218 [characters]
This is the code for the refresh:
Range("YHOOCompanyData").QueryTable.Refresh BackgroundQuery:=False Range("GoogleWebData").QueryTable.Refresh BackgroundQuery:=False
These are the actual queries: ([Ticker] just refers to some other cell)
WEB 1
["Ticker"]
Selection=EntirePage
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False
WEB 1
["Ticker"]
Selection=EntirePage
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False
Possible solutions I have tried already and haven't had much success...
1) Deleting the IE cache and restarting excel
2) adding a loop around the web query (maybe i'm doing it wrong, if anyone has sample code that would be nice) so it re-queries until it gets the data. maybe adding a 5 second wait time would help?
I try refreshing manually and it works maybe 70% of the time. It really varies.
Run Time Error 1004
the file could not be accessed. Try one of the following:
-Make sure the folder exists
-Make sure the file isn't read only
-Make sure no < > | [and other special characters] are in the filename
-Make sure the file path is less than 218 [characters]
This is the code for the refresh:
Range("YHOOCompanyData").QueryTable.Refresh BackgroundQuery:=False Range("GoogleWebData").QueryTable.Refresh BackgroundQuery:=False
These are the actual queries: ([Ticker] just refers to some other cell)
WEB 1
["Ticker"]
Selection=EntirePage
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False
WEB 1
["Ticker"]
Selection=EntirePage
Formatting=None
PreFormattedTextToColumns=True
ConsecutiveDelimitersAsOne=True
SingleBlockTextImport=False
DisableDateRecognition=False
DisableRedirections=False
Possible solutions I have tried already and haven't had much success...
1) Deleting the IE cache and restarting excel
2) adding a loop around the web query (maybe i'm doing it wrong, if anyone has sample code that would be nice) so it re-queries until it gets the data. maybe adding a 5 second wait time would help?
I try refreshing manually and it works maybe 70% of the time. It really varies.