ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IQY File: Invalid Web Query (https://www.excelbanter.com/excel-programming/427761-iqy-file-invalid-web-query.html)

CM4@FL[_2_]

IQY File: Invalid Web Query
 
I'm using an iqy file to import websites to excel. The text within the iqy
file is as follows:
WEB
1
http://finance.yahoo.com/q/hp?s=["Company"]

The ["Company"] parameter is linked to a specific cell, which is my variable
(stock ticker symbols). I created a macro to to refresh the work book, the
VBA code reads as follows:
Sub Macro1()
ActiveWorkbook.RefreshAll
End Sub

I entered EBAY into the ["Company"] parameter cell and ran my macro, then an
error messaged appeared.
"The file could not be accessed. Try one of the following:
-make sure the specified folder exists
-make sure the folder that contains the file is not read-only
-make sure the file name does not contain any of the following
characters:
-make sure the file/path name doesn't contain more than 218 characters.
When I close out of that error another error appears.
"Invalid Web Query"

The entire process works for some ticker symbols but not others; even when
the website truly exists.

Please help!
Thanks



Mike Fogleman[_2_]

IQY File: Invalid Web Query
 
Try removing the brackets from the "Company".

Mike F
"CM4@FL" wrote in message
...
I'm using an iqy file to import websites to excel. The text within the iqy
file is as follows:
WEB
1
http://finance.yahoo.com/q/hp?s=["Company"]

The ["Company"] parameter is linked to a specific cell, which is my
variable
(stock ticker symbols). I created a macro to to refresh the work book,
the
VBA code reads as follows:
Sub Macro1()
ActiveWorkbook.RefreshAll
End Sub

I entered EBAY into the ["Company"] parameter cell and ran my macro, then
an
error messaged appeared.
"The file could not be accessed. Try one of the following:
-make sure the specified folder exists
-make sure the folder that contains the file is not read-only
-make sure the file name does not contain any of the following
characters:
-make sure the file/path name doesn't contain more than 218
characters.
When I close out of that error another error appears.
"Invalid Web Query"

The entire process works for some ticker symbols but not others; even when
the website truly exists.

Please help!
Thanks





joel

IQY File: Invalid Web Query
 
You need something like this

MyStr = "http://finance.yahoo.com/q/hp?s=" & Company


Try this complete code

Company = "EBAY"
URL = "http://finance.yahoo.com/q?s=" & Company

Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True

'get web page
IE.Navigate2 URL
Do While IE.readyState < 4
DoEvents
Loop

Do While IE.busy = True
DoEvents
Loop

"CM4@FL" wrote:

I'm using an iqy file to import websites to excel. The text within the iqy
file is as follows:
WEB
1
http://finance.yahoo.com/q/hp?s=["Company"]

The ["Company"] parameter is linked to a specific cell, which is my variable
(stock ticker symbols). I created a macro to to refresh the work book, the
VBA code reads as follows:
Sub Macro1()
ActiveWorkbook.RefreshAll
End Sub

I entered EBAY into the ["Company"] parameter cell and ran my macro, then an
error messaged appeared.
"The file could not be accessed. Try one of the following:
-make sure the specified folder exists
-make sure the folder that contains the file is not read-only
-make sure the file name does not contain any of the following
characters:
-make sure the file/path name doesn't contain more than 218 characters.
When I close out of that error another error appears.
"Invalid Web Query"

The entire process works for some ticker symbols but not others; even when
the website truly exists.

Please help!
Thanks




All times are GMT +1. The time now is 08:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com