LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Excel 2003 - Copy Variant to Clipboard?

When using ADO record sets, I can do something like the following:

Dim ADODB_Connection As ADODB.Connection
Dim ADODB_Command As ADODB.Command
Dim ADODB_RecordSet As ADODB.RecordSet
Dim varRecordSet As Variant, varTransposed As Variant

....(ADO setup stuff) ...
Set ADODB_RecordSet = ADODB_Command.Execute
varRecordSet = ADODB_RecordSet.GetRows

but if continue with something like

Worksheets(1).Range("SomethingAppropriate").Value = varRecordSet

it comes out in c,r format (limiting rows returned to 256) instead of r,c
format.

Right now, I do something like the following:

For r = 1 to NumRows
For c = 1 to NumCols
varTransposed(r,c) = varRecordSet(c-1,r-1)
Next c
Next r

I was wondering if there was some way to move varRecordSet onto the
clipboard, then do something like

..PasteSpecial xlTransposed

instead of manually transposing the array.

Thanks, Bob

P.S. I looked into the DataObject, but it seems only to handle a string.

 
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
Excel 2003 Clipboard Question CommMajor Excel Discussion (Misc queries) 6 November 11th 09 09:21 PM
Excel 2003 Clipboard CommMajor Excel Discussion (Misc queries) 0 November 4th 09 04:51 PM
Transfer clipboard from Task pane clipboard(office?) content to Excel (windows?) clipboard? tskogstrom Excel Programming 2 March 6th 07 12:50 PM


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