Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Web query .Refresh BackgroundQuery:=False problem

I have a series of macros, the first of which captures a user-inputted
URL and the second of which uses that input to launch a web query to
pull in some select tables. My goal is to use one macro, attached to a
toolbar button, to run through the series of macros. When I run the
macros separately everything works fine. When I run one macro that
calls them all, the macro that creates the web query fails at the line
referenced in the subject line. Any help would be appreciated. My
code:

Sub URLBox()
Dim thumbURL As String
Workbooks.Add
thumbURL = InputBox("Paste complete thumbnail page URL", "Thumbnail
URL")
Range("A1").Value = thumbURL
End Sub
Sub WebQuery()
Dim sourcestring As String
sourcestring = "URL;" & Range("A1").Value
With ActiveSheet.QueryTables.Add(Connection:=sourcestri ng _
, Destination:=Range("B4"))
..Name = _

"CategoryDisplay?categoryId=3625&cat4=6248&storeId =1&catalogId=1&langId=-1&feat=ssdpa6248"
..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 = "11,12,13,14,15,16,17,18,19,20,21,22,23,24"
..WebPreFormattedTextToColumns = True
..WebConsecutiveDelimitersAsOne = True
..WebSingleBlockTextImport = False
..WebDisableDateRecognition = False
..Refresh BackgroundQuery:=False
'This line above is what's causing the problem
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Web query .Refresh BackgroundQuery:=False problem

I ended up just adding a Wait statement after creating the web query,
eliminating the Refresh in the With statement, and instead putting the
Refresh after the Wait. All seems to work fine now.

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
Web Query Refresh problem Tone Excel Discussion (Misc queries) 0 November 21st 05 12:12 PM
Problems with .Refresh BackgroundQuery:=False dmplacebo Excel Worksheet Functions 0 July 11th 05 12:39 PM
Timing of automatic query refresh and macro pivot table refresh dutty Excel Programming 2 December 1st 04 07:19 PM
Refresh BackgroundQuery problem when migrating to Excel XP Doron Hadar Excel Programming 1 November 4th 04 10:10 PM
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) Anant[_2_] Excel Programming 1 August 6th 03 04:22 AM


All times are GMT +1. The time now is 07:46 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"