Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pull Recipient from Outlook Address book BigPig Excel Programming 9 May 26th 09 06:34 AM
Pop up window prompt for name/address upon opening of file HRgal Excel Programming 2 August 22nd 06 04:39 PM
Pull in address from another worksheet S. Hernandez Excel Worksheet Functions 7 July 31st 06 04:07 PM
I want to pull out certain address in excel and put into a file neiled Excel Programming 1 September 22nd 05 08:53 PM
I want to pull out companies without an email address? Pudlicious Excel Worksheet Functions 0 March 15th 05 04:43 PM


All times are GMT +1. The time now is 04:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"