ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Programming a macro to draw info from a list of links (https://www.excelbanter.com/excel-programming/404904-re-programming-macro-draw-info-list-links.html)

snowman

Programming a macro to draw info from a list of links
 
Run-time error 450, Wrong number of arguments or invalid property assignment.



"Joel" wrote:

Sub URL_Get_Data()
celladdress = Cells(Rows.Count, "A").End(xlUp)(2).address
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & _
"Destination:=Sheets(""Links"").Range(" & celladdress & ")")

.BackgroundQuery = True
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.Refresh BackgroundQuery:=True
.SaveData = True
End With
End Sub





joel

Programming a macro to draw info from a list of links
 
Can you post the code that worked before you made modifications. Queries are
hard to debug unless you havve the actual database or webpage.

Usually I get Queries to work by recording a macro and then modifiying the
recorded macro as necessary.

"Snowman" wrote:

Run-time error 450, Wrong number of arguments or invalid property assignment.



"Joel" wrote:

Sub URL_Get_Data()
celladdress = Cells(Rows.Count, "A").End(xlUp)(2).address
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & _
"Destination:=Sheets(""Links"").Range(" & celladdress & ")")

.BackgroundQuery = True
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.Refresh BackgroundQuery:=True
.SaveData = True
End With
End Sub





snowman

Programming a macro to draw info from a list of links
 
I never had any that worked. I began with the sample from this article:

http://support.microsoft.com/kb/213730

"Joel" wrote:

Can you post the code that worked before you made modifications. Queries are
hard to debug unless you havve the actual database or webpage.

Usually I get Queries to work by recording a macro and then modifiying the
recorded macro as necessary.

"Snowman" wrote:

Run-time error 450, Wrong number of arguments or invalid property assignment.



"Joel" wrote:

Sub URL_Get_Data()
celladdress = Cells(Rows.Count, "A").End(xlUp)(2).address
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;" & _
"Destination:=Sheets(""Links"").Range(" & celladdress & ")")

.BackgroundQuery = True
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "2"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.Refresh BackgroundQuery:=True
.SaveData = True
End With
End Sub






All times are GMT +1. The time now is 09:29 AM.

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