Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I edit a protected cell to enter a value manually and thenprotect it again (automatically) | Excel Discussion (Misc queries) | |||
Stop to modify the SQL query manually entered into query ! | Excel Programming | |||
Edit Macro to work for other Workbooks | Excel Programming | |||
Macro and Edit query help | Excel Programming | |||
Excel open an existing MS Query in edit mode via macro attached to a button. | Excel Programming |