PC Review


Reply
Thread Tools Rate Thread

copy query table data

 
 
namenorg
Guest
Posts: n/a
 
      6th Dec 2008
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 With Quote
 
 
 
 
Pal
Guest
Posts: n/a
 
      6th Dec 2008
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
>
>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      6th Dec 2008
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
(E-Mail Removed)
"namenorg" <(E-Mail Removed)> wrote in message
news:47D4DBD6-243B-4157-B351-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search one table to copy and paste select data to another table Sarah Microsoft Access VBA Modules 1 12th Dec 2008 06:42 PM
Pivot Table - Copy All Data from a Specific Variable Data Field troy.litwiler@gmail.com Microsoft Excel Discussion 1 8th Feb 2007 04:36 AM
SQL Query to copy Data from One Table to another Table having same names but from different databases apurv.agarwal@gmail.com Microsoft Access Queries 1 20th Nov 2006 05:54 PM
VB2005 : Create table in Access - copy of another table but without the data Screaming Eagles 101 Microsoft ADO .NET 2 18th Oct 2006 04:25 PM
How to copy 9 fields data from table to other table automatically =?Utf-8?B?QWxhbjQ4?= Microsoft Access VBA Modules 8 21st Jul 2005 01:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:18 AM.