View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Eric Eric is offline
external usenet poster
 
Posts: 1,670
Default What wrong with defined variable?

I forget the error has been fixed. Based on both following queries, the first
one can load the code for 1, but the second one cannot do it.
Do you have any suggestions on what wrong it is and how to solve it?
Thank you very much for your reply and suggestions
I look forward to your reply
Eric

[Can load the code = 1]
With Sheets("Temp").QueryTables.Add(Connection:= _
"URL;http://www.quamnet.com/quote.action?quoteSectionCode=&stockCode=1",
Destination:=Sheets("Temp").Range("$A$1"))

[Cannot load the code = 1]
Mywebsite = 1
With Sheets("Temp").QueryTables.Add(Connection:= _
"URL;http://www.quamnet.com/quote.action?quoteSectionCode=&stockCode=" &
Mywebsite & """", Destination:=Sheets("Temp").Range("$A$1"))


"Gary''s Student" wrote:

I don't see:
.Refresh BackgroundQuery:=False

in the post
--
Gary''s Student - gsnu200773


"Eric" wrote:

Thank you very much for your suggestion
Do you have any suggestions on following error? and do you have any
suggestions on how to fix it?
Thank you very much for any suggestions
Eric

[Working]
With Sheets("Temp").QueryTables.Add(Connection:= _
"URL;http://www.quamnet.com/quote.action?quoteSectionCode=&stockCode=1",
Destination:=Sheets("Temp").Range("$A$1"))

[Not working]
Mywebsite = 1
With Sheets("Temp").QueryTables.Add(Connection:= _
"URL;http://www.quamnet.com/quote.action?quoteSectionCode=&stockCode=" &
Mywebsite & """", Destination:=Sheets("Temp").Range("$A$1"))

Error pointing to
.Refresh BackgroundQuery:=False


"Gary''s Student" wrote:

Instead of:
Set Mywebsite = "http://www.stata.com/help.cgi?macro"
use:
Mywebsite = "http://www.stata.com/help.cgi?macro"
--
Gary''s Student - gsnu200773