Creating temp copy of activeworkbook in Excel

Add-in Express™ Support Service
That's what is more important than anything else

Creating temp copy of activeworkbook in Excel
 
Phillippe Allen




Posts: 30
Joined: 2005-11-07
I wish to create a copy of the activeworkbook which I can then perform various actions on eg streaming it to memory to save it into a databse etc.

I hae experimented with doing a simple saveas but this requires the activeworkbook to be closed before I can then load it into a TStream object.

Is there any way that I can do this easily in Excel?
Posted 22 Nov, 2005 18:48:35 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Phillippe,

I think you need the SaveCopyAs method of the _Workbook interface.

---
SaveCopyAs Method

Saves a copy of the workbook to a file but doesn't modify the open workbook in memory.
---
Posted 23 Nov, 2005 07:00:07 Top
Phillippe Allen




Posts: 30
Joined: 2005-11-07
Thanks that works perfectly. Not sure how I missed that method -put it down to stupidity maybe?
Posted 23 Nov, 2005 17:52:37 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Phillippe,

I am glad everything works. Good luck.

Posted 24 Nov, 2005 06:59:18 Top