Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default copy query table data

when i run the following macro i get the data from the website, but when i
try to copy it to another location i get the following: "ExternalData_55:
Getting Data €¦"

how can i get the macro to wait for the data to be imported before copying?

any help is greatly appreciated - here is macro:

Sub MacroTest1()

With
ActiveSheet.QueryTables.Add(Connection:="URL;http://www.license.state.tx.us/ABProjectRegistrationOnline/ABProjectPrintConfirmationGeneral.aspx?strWhereURL =ABDataSearch&strProjNum=EABPRJA8800466", Destination:=Range("a1"))
.WebFormatting = xlNone
.WebSelectionType = xlSpecifiedTables
.WebTables = "5"
.Refresh
End With
Range("a1").Copy
Range("b1").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True

End Sub



  #2   Report Post  
Posted to microsoft.public.excel.programming
PAL PAL is offline
external usenet poster
 
Posts: 200
Default copy query table data

simply, you can use a " Wait " function

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime


"namenorg" δΎ†ε‡½οΌš

when i run the following macro i get the data from the website, but when i
try to copy it to another location i get the following: "ExternalData_55:
Getting Data €¦"

how can i get the macro to wait for the data to be imported before copying?

any help is greatly appreciated - here is macro:

Sub MacroTest1()

With
ActiveSheet.QueryTables.Add(Connection:="URL;http://www.license.state.tx.us/ABProjectRegistrationOnline/ABProjectPrintConfirmationGeneral.aspx?strWhereURL =ABDataSearch&strProjNum=EABPRJA8800466", Destination:=Range("a1"))
.WebFormatting = xlNone
.WebSelectionType = xlSpecifiedTables
.WebTables = "5"
.Refresh
End With
Range("a1").Copy
Range("b1").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default copy query table data

Changing to backgroundquery:=false will cure your immediate problem.
However, I suspect you have more. Contact me privately if desired

Sub MacroTest1()

With
ActiveSheet.QueryTables.Add(Connection:="URL;http://www.license.state.tx.us/ABProjectRegistrationOnline/ABProjectPrintConfirmationGeneral.aspx?strWhereURL =ABDataSearch&strProjNum=EABPRJA8800466",
Destination:=Range("a1"))
.WebFormatting = xlNone
.WebSelectionType = xlSpecifiedTables
.WebTables = "5"
'.Refresh
.Refresh BackgroundQuery:=False
End With

Range("a1").Copy Range("b1")

End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"namenorg" wrote in message
...
when i run the following macro i get the data from the website, but when i
try to copy it to another location i get the following: "ExternalData_55:
Getting Data €¦"

how can i get the macro to wait for the data to be imported before
copying?

any help is greatly appreciated - here is macro:

Sub MacroTest1()

With
ActiveSheet.QueryTables.Add(Connection:="URL;http://www.license.state.tx.us/ABProjectRegistrationOnline/ABProjectPrintConfirmationGeneral.aspx?strWhereURL =ABDataSearch&strProjNum=EABPRJA8800466",
Destination:=Range("a1"))
.WebFormatting = xlNone
.WebSelectionType = xlSpecifiedTables
.WebTables = "5"
.Refresh
End With
Range("a1").Copy
Range("b1").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:=False, Transpose:=True

End Sub




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
QUERY EXCEL TABLE DATA ibo4lyf Excel Programming 1 February 26th 08 07:19 PM
SQL query JOINED Data from which Table? Abdul[_2_] Excel Programming 1 April 8th 06 07:45 AM
Copy old Data from web query while keeping previous days data DRobidoux Excel Worksheet Functions 0 March 22nd 06 01:56 PM
Userform web Data query table alcorjr[_3_] Excel Programming 0 January 29th 04 06:49 PM
Append Data to Table after Web Query OmaSteak Excel Programming 0 January 29th 04 05:45 PM


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