Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 206
Default 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




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid web query Excel 2007 Bob Excel Discussion (Misc queries) 0 June 26th 09 03:51 PM
Invalid Web Query Error Alfredo_CPA Excel Programming 6 September 29th 08 01:13 PM
Invalid Web Query errors. YellowBird Excel Programming 2 May 30th 06 04:36 PM
why dose excel return invalid web query Barry Excel Discussion (Misc queries) 0 February 25th 06 10:07 PM
Locating Invalid Web Query Data Scott Excel Programming 0 February 7th 06 12:14 PM


All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"