ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Automation from VB6 (https://www.excelbanter.com/excel-programming/317037-automation-vb6.html)

Robert A. Boudra

Automation from VB6
 
I've got a VB 6 project where I am populating a spreadsheet with data from
an ADO recordset and I've got a couple of questions.

First, is anyone aware of a way to populate the spreadsheet quickly? Right
now, I'm cycling through every record and field of the recordset, reading
the value from the recoordset, and then pasting the value into the the
corresponding spreadsheet cell. Seems to be very slow!

Second, is there any way to check to see if the user has manually closed the
Excel session before I attempt to close it in code?

Thanks for any help.

Bob



Bob Phillips[_6_]

Automation from VB6
 
Bob,

The CopyFromRecordset method copies the RS to a worksheet range.
--

HTH

RP
(remove nothere from the email address if mailing direct)


"Robert A. Boudra" wrote in message
...
I've got a VB 6 project where I am populating a spreadsheet with data

from
an ADO recordset and I've got a couple of questions.

First, is anyone aware of a way to populate the spreadsheet quickly?

Right
now, I'm cycling through every record and field of the recordset, reading
the value from the recoordset, and then pasting the value into the the
corresponding spreadsheet cell. Seems to be very slow!

Second, is there any way to check to see if the user has manually closed

the
Excel session before I attempt to close it in code?

Thanks for any help.

Bob





Robert A. Boudra

Automation from VB6
 
Thanks! That works great!

Bob

"Bob Phillips" wrote in message
...
Bob,

The CopyFromRecordset method copies the RS to a worksheet range.
--

HTH

RP
(remove nothere from the email address if mailing direct)


"Robert A. Boudra" wrote in message
...
I've got a VB 6 project where I am populating a spreadsheet with data

from
an ADO recordset and I've got a couple of questions.

First, is anyone aware of a way to populate the spreadsheet quickly?

Right
now, I'm cycling through every record and field of the recordset,

reading
the value from the recoordset, and then pasting the value into the the
corresponding spreadsheet cell. Seems to be very slow!

Second, is there any way to check to see if the user has manually closed

the
Excel session before I attempt to close it in code?

Thanks for any help.

Bob








All times are GMT +1. The time now is 09:19 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com