LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Web query in macro doesn't work until you manually edit it

Hi all:

I've assigned the following macro containing a web query to a
workbook (not a particular sheet in a workbook):

Sub GetListOfTravellersForATournament()
'
' X Macro
' Macro recorded 3/23/2005 by AdministratorHDT
'
Worksheets("Sheet1").Select
Worksheets("Sheet1").Range("A1:Z200").Delete shift:=xlShiftUp
Range("A2").Select
'
With ActiveSheet.QueryTables.Add(Connection:= _
"URL;http://online.bridgebase.com/myhands/" & _
"hands.php?tourney=150-1112822060-", _
Destination:=Range("A1"))
.Name = _
"Tournament #" & Worksheets("Sheet1").Range("A1").Value
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = False
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingAll
.WebTables = "3"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub

When I run the macro from the Tools / Macro / Macros dialog box nothing
happens. I receive no error messages and the query does not populate
Sheet1.

When I use the Data / Import External Data / Edit Query Data menu to
bring up the query, immediately press the Cancel button, and then
execute the Macro it runs successfully.

I tried using the Macro Recorder to see what changes Excel makes to the
query when I execute the Data / Import External Data / Edit Query Data
command sequence. The resulting macro is empty! Go figure.

What gives? I admit I am a newbie regarding web queries. Other than the
debugging I described above I don't know how else to debug them. Any
debugging suggestions welcome.

There's probably something simple going on here that I don't
understand. Can anyone help me?

Moxy

 
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
How can I edit a protected cell to enter a value manually and thenprotect it again (automatically) SNM Excel Discussion (Misc queries) 7 February 7th 08 01:30 PM
Stop to modify the SQL query manually entered into query ! Olivier Rollet Excel Programming 6 November 3rd 04 08:34 AM
Edit Macro to work for other Workbooks DAA[_2_] Excel Programming 1 April 19th 04 12:33 PM
Macro and Edit query help qitrader888 Excel Programming 1 February 26th 04 05:10 AM
Excel open an existing MS Query in edit mode via macro attached to a button. systems analyst Excel Programming 1 October 3rd 03 12:08 PM


All times are GMT +1. The time now is 01:31 AM.

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

About Us

"It's about Microsoft Excel"