Hi there
I have written a web query to fetch information from a web page containing company address details. Each company has its own sub-page with a predictable URL, such that I now have a list of these urls for each company in question and these are arranged into a single row on my worksheet.
I have then used the web query wizard to fetch all the data from a given page and it pastes it as a column with the first cell being the one immediately below the cell with the URL in it. Nice so far.
What I want to do is write a macro such that I can loop this web query to do the same job for each URL.
I have an integer variable (RS_X) that increments each cycle which essentially counts the horizontal position from the left.
I am having trouble getting the web query code to directly address a cell value however.
So far I have:
This produces the error "wrong number of arguments or invalid property assignment". I don't know what that means exactly.
Now I am reasonably proficient at excel but a relative n00b with VBA. So if there are some glaringly obvious coding errors, please point them out, they are not obvious to me!
If I am going about this the wrong way then please advise an alternative method if more appropriate.
Thanks in advance
Robin
I have written a web query to fetch information from a web page containing company address details. Each company has its own sub-page with a predictable URL, such that I now have a list of these urls for each company in question and these are arranged into a single row on my worksheet.
I have then used the web query wizard to fetch all the data from a given page and it pastes it as a column with the first cell being the one immediately below the cell with the URL in it. Nice so far.
What I want to do is write a macro such that I can loop this web query to do the same job for each URL.
I have an integer variable (RS_X) that increments each cycle which essentially counts the horizontal position from the left.
I am having trouble getting the web query code to directly address a cell value however.
So far I have:
Code:
With ActiveSheet.QueryTables.Add(Connection:= ActiveSheet.Cells(3, RS_X).Value, Destination:=ActiveSheet.Cells(4, RS_X).Range)
/* Removed Query filter info */
End With
This produces the error "wrong number of arguments or invalid property assignment". I don't know what that means exactly.
Now I am reasonably proficient at excel but a relative n00b with VBA. So if there are some glaringly obvious coding errors, please point them out, they are not obvious to me!
If I am going about this the wrong way then please advise an alternative method if more appropriate.
Thanks in advance
Robin