Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Pasting ADODB recordset into unopened workbooks II

Hi,

I'm trying to paste data into a workbook from an ADODB recordset using
..CopyFromRecordset rsData. However, I'd prefer not to open the target
workbook, because this slows things down a lot (when executed on 50+ files).

Is there a way to use .CopyFromRecordset rsData with an unopened workbook?

Or alternatively, is there a way I can set up a connection to the targetfile
and use an "Insert * From" string to refer to a variant array?

In other words, is there a way to: create the ADODB recordset from the
source file, paste the data into thisworkbook and create a vaData from this,
which is then used as "VALUES(vaData)" in the insert connection string? (I've
gotten as far as pasting the data and creating the vaData, but I can't get it
to work in the insert string.)

Many thanks for any tips.

Regards,
JvL

PS I am reposting so others don't have to deal with Tom Ogilvy's unhelpful
comment.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Pasting ADODB recordset into unopened workbooks II

why not write it as a .CSV file, then when you open it in Excel, it will be
shown as a workbook (which you can then saveas)?

Mike F
"JVLin" wrote in message
...
Hi,

I'm trying to paste data into a workbook from an ADODB recordset using
.CopyFromRecordset rsData. However, I'd prefer not to open the target
workbook, because this slows things down a lot (when executed on 50+
files).

Is there a way to use .CopyFromRecordset rsData with an unopened workbook?

Or alternatively, is there a way I can set up a connection to the
targetfile
and use an "Insert * From" string to refer to a variant array?

In other words, is there a way to: create the ADODB recordset from the
source file, paste the data into thisworkbook and create a vaData from
this,
which is then used as "VALUES(vaData)" in the insert connection string?
(I've
gotten as far as pasting the data and creating the vaData, but I can't get
it
to work in the insert string.)

Many thanks for any tips.

Regards,
JvL

PS I am reposting so others don't have to deal with Tom Ogilvy's unhelpful
comment.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Pasting ADODB recordset into unopened workbooks II

Super Mike! Way to go!
I hadn't thought of that!
How old are you!
And how long have you been unemployed?



"Mike Fogleman" wrote:

why not write it as a .CSV file, then when you open it in Excel, it will be
shown as a workbook (which you can then saveas)?

Mike F
"JVLin" wrote in message
...
Hi,

I'm trying to paste data into a workbook from an ADODB recordset using
.CopyFromRecordset rsData. However, I'd prefer not to open the target
workbook, because this slows things down a lot (when executed on 50+
files).

Is there a way to use .CopyFromRecordset rsData with an unopened workbook?

Or alternatively, is there a way I can set up a connection to the
targetfile
and use an "Insert * From" string to refer to a variant array?

In other words, is there a way to: create the ADODB recordset from the
source file, paste the data into thisworkbook and create a vaData from
this,
which is then used as "VALUES(vaData)" in the insert connection string?
(I've
gotten as far as pasting the data and creating the vaData, but I can't get
it
to work in the insert string.)

Many thanks for any tips.

Regards,
JvL

PS I am reposting so others don't have to deal with Tom Ogilvy's unhelpful
comment.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Pasting ADODB recordset into unopened workbooks II


http://support.microsoft.com/kb/295646/en-us
How To Transfer Data from ADO Data Source to Excel with ADO

http://support.microsoft.com/kb/247412/en-us
Methods for transferring data to Excel from Visual Basic

http://support.microsoft.com/kb/257819/en-us
How To Use ADO with Excel Data from Visual Basic or VBA


--
Regards,
Tom Ogilvy


"JVLin" wrote in message
...
Super Mike! Way to go!
I hadn't thought of that!
How old are you!
And how long have you been unemployed?



"Mike Fogleman" wrote:

why not write it as a .CSV file, then when you open it in Excel, it will
be
shown as a workbook (which you can then saveas)?

Mike F
"JVLin" wrote in message
...
Hi,

I'm trying to paste data into a workbook from an ADODB recordset using
.CopyFromRecordset rsData. However, I'd prefer not to open the target
workbook, because this slows things down a lot (when executed on 50+
files).

Is there a way to use .CopyFromRecordset rsData with an unopened
workbook?

Or alternatively, is there a way I can set up a connection to the
targetfile
and use an "Insert * From" string to refer to a variant array?

In other words, is there a way to: create the ADODB recordset from the
source file, paste the data into thisworkbook and create a vaData from
this,
which is then used as "VALUES(vaData)" in the insert connection string?
(I've
gotten as far as pasting the data and creating the vaData, but I can't
get
it
to work in the insert string.)

Many thanks for any tips.

Regards,
JvL

PS I am reposting so others don't have to deal with Tom Ogilvy's
unhelpful
comment.






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
Pasting ADODB recordset into unopened workbooks JVLin Excel Programming 3 September 13th 06 03:07 AM
ADODB.Recordset from workbooks : numbers only? JVLin Excel Programming 2 August 16th 06 04:56 AM
0 with ADODB Recordset Stefen Percoco Excel Programming 1 July 8th 04 09:54 PM
adodb.recordset with excel nate axtell Excel Programming 14 June 11th 04 01:32 PM
ADODB Recordset Seth[_3_] Excel Programming 0 August 5th 03 02:15 PM


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

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"