Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with prompt to pull wed address
I am trying to use a macro that will prompt for a web address then store that address in a querytable. What I have so far is below. The prompt works but It errors out when you select OK on the inputbox. If I comment out myRange and just hardcode the address it will work. Any suggestions Thanks Bob Set myRange = Application.InputBox(prompt:="Web Address", Type:=2) With ActiveSheet.QueryTables.Add(Connection:=myRange, Destination:=Range("$A$1")) .Name = _ "" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlSpecifiedTables .WebFormatting = xlWebFormattingNone .WebTables = "68" .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
help with prompt to pull wed address
Bobbo,
Your myRange appears to be a range object. You cannot set the range object to be a string value, but you could set the myRange object's value to be the string. This is how you could work with it: Dim myRange As Range Set myRange = ActiveCell myRange.Value = Application.InputBox(prompt:="Web Address", Type:=2) thought there is no clue as to which cell you want to be myRange.... HTH, Bernie MS Excel MVP "Bobbo" wrote in message ... I am trying to use a macro that will prompt for a web address then store that address in a querytable. What I have so far is below. The prompt works but It errors out when you select OK on the inputbox. If I comment out myRange and just hardcode the address it will work. Any suggestions Thanks Bob Set myRange = Application.InputBox(prompt:="Web Address", Type:=2) With ActiveSheet.QueryTables.Add(Connection:=myRange, Destination:=Range("$A$1")) .Name = _ "" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlSpecifiedTables .WebFormatting = xlWebFormattingNone .WebTables = "68" .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pull Recipient from Outlook Address book | Excel Programming | |||
Pop up window prompt for name/address upon opening of file | Excel Programming | |||
Pull in address from another worksheet | Excel Worksheet Functions | |||
I want to pull out certain address in excel and put into a file | Excel Programming | |||
I want to pull out companies without an email address? | Excel Worksheet Functions |