View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ron ron is offline
external usenet poster
 
Posts: 118
Default Assign Web Query Result to a Variable

I'm running the following web query and it works fine. As written it
pastes the web page onto the active sheet starting at cell A1. Is
there a way to bypass pasting the web page to the worksheet and
instead assign the web page HTML or text to a variable?..TIA, ron

' Connect to the site
With ActiveSheet.QueryTables.Add(Connection:= my_url,
Destination:=Range("A1"))
.BackgroundQuery = True
.TablesOnlyFromHTML = True
.Refresh BackgroundQuery:=False
.SaveData = True
End With