![]() |
inporting data from website where website address frequently chang
Hello, thanks in advance for your help.
I need to finish a macro that opens "get external data"/"import data"/ and then places the website typed into the 'myinput' field into the field box. The website has different pages for the same type data. http://www.website.org/app.php?page=...about&id=99999 I know it's something regarding that "FINDER: @@@" statement. Here's where i'm at: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 6/21/2007 by me ' Dim Website Website = InputBox("Enter the Address of the site") ' Range("C117").Select ActiveWindow.SmallScroll Down:=-3 ActiveWindow.LargeScroll Down:=-3 Range("A1").Select Sheets("Sheet2").Select ActiveWorkbook.Worksheets.Add With ActiveSheet.QueryTables.Add(Connection:= _ "FINDER;http://www.website.org/app.php?page=businesses&action=about&id=99999", _ Destination:=Range("A1")) .Name = "app.php?page=businesses&action=about&id=99999 " .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlEntirePage .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With End Sub |
inporting data from website where website address frequently c
THANK YOU DON! with a few changes it worked, thanks!!!!!!
"Don Guillett" wrote: IF??? you are trying to change the url, use a variable Sub GetUrl() Website = InputBox("Enter the Address of the site") 'assuming answer is 99999 you would get 'http://www.website.org/app.php?page=businesses&action=about&id=99999 murl="http://www.website.org/app.php?page=businesses&action=about&id="& website ActiveWorkbook.Worksheets.Add With ActiveSheet..QueryTables.Add( _ Connection:="URL;" & myurl, Destination:=.Cells(1, 1)) .BackgroundQuery = True .TablesOnlyFromHTML = False .Refresh BackgroundQuery:=False .SaveData = True End With end sub If not, you may change url strings "http://www.website"&xxxxxxxxxx&"bbbbbbbb" -- Don Guillett SalesAid Software "HP" wrote in message ... Hello, thanks in advance for your help. I need to finish a macro that opens "get external data"/"import data"/ and then places the website typed into the 'myinput' field into the field box. The website has different pages for the same type data. http://www.website.org/app.php?page=...about&id=99999 I know it's something regarding that "FINDER: @@@" statement. Here's where i'm at: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 6/21/2007 by me ' Dim Website Website = InputBox("Enter the Address of the site") ' Range("C117").Select ActiveWindow.SmallScroll Down:=-3 ActiveWindow.LargeScroll Down:=-3 Range("A1").Select Sheets("Sheet2").Select ActiveWorkbook.Worksheets.Add With ActiveSheet.QueryTables.Add(Connection:= _ "FINDER;http://www.website.org/app.php?page=businesses&action=about&id=99999", _ Destination:=Range("A1")) .Name = "app.php?page=businesses&action=about&id=99999 " .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlEntirePage .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With End Sub |
inporting data from website where website address frequently c
Glad to help. Always nice to publish your final result for archival purposes -- Don Guillett SalesAid Software "HP" wrote in message ... THANK YOU DON! with a few changes it worked, thanks!!!!!! "Don Guillett" wrote: IF??? you are trying to change the url, use a variable Sub GetUrl() Website = InputBox("Enter the Address of the site") 'assuming answer is 99999 you would get 'http://www.website.org/app.php?page=businesses&action=about&id=99999 murl="http://www.website.org/app.php?page=businesses&action=about&id="& website ActiveWorkbook.Worksheets.Add With ActiveSheet..QueryTables.Add( _ Connection:="URL;" & myurl, Destination:=.Cells(1, 1)) .BackgroundQuery = True .TablesOnlyFromHTML = False .Refresh BackgroundQuery:=False .SaveData = True End With end sub If not, you may change url strings "http://www.website"&xxxxxxxxxx&"bbbbbbbb" -- Don Guillett SalesAid Software "HP" wrote in message ... Hello, thanks in advance for your help. I need to finish a macro that opens "get external data"/"import data"/ and then places the website typed into the 'myinput' field into the field box. The website has different pages for the same type data. http://www.website.org/app.php?page=...about&id=99999 I know it's something regarding that "FINDER: @@@" statement. Here's where i'm at: Sub Macro1() ' ' Macro1 Macro ' Macro recorded 6/21/2007 by me ' Dim Website Website = InputBox("Enter the Address of the site") ' Range("C117").Select ActiveWindow.SmallScroll Down:=-3 ActiveWindow.LargeScroll Down:=-3 Range("A1").Select Sheets("Sheet2").Select ActiveWorkbook.Worksheets.Add With ActiveSheet.QueryTables.Add(Connection:= _ "FINDER;http://www.website.org/app.php?page=businesses&action=about&id=99999", _ Destination:=Range("A1")) .Name = "app.php?page=businesses&action=about&id=99999 " .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = False .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlEntirePage .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With End Sub |
All times are GMT +1. The time now is 05:12 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com