xp sp3 10.6501.6735 SaveCopyAs, Open copy, SaveAs copy sequence Closes first workbook

4

4usenet

Hi there,
im coding an Excel AddIn ( custom command bar + 1 button ), in
c++/atl/wtl

i need to upload active workbook as xml to the web, but i have not
touch this active wb in any way.

So first i do

CComPtr<xl::_Workbook> first;
first->SaveCopyAs(filename)

then i open it in same application. After removing a few sheets, i try
to save it

hr = wb->SaveAs(
CComVariant(filename2),
CComVariant(xl::xlXMLSpreadsheet),
vtMissing,
vtMissing,
vtMissing,
vtMissing,
xl::xlNoChange
);

this goes ok, though visual studio detects probably win32 exception:
RPC server unavailable ( or not available)

then i do wb->Close(), so the xml Workbook is closed, but the first
original should be still there, right?

sooo, everyting works nice, except when i perform that on clean
workbook, i.e i launch excel and immediately press my custom upload
button which performs the sequence above..

with blank template workbook, after closing the XML spreadsheet, the
first workbook is not there too..

everyting is done in the same thread.
 
4

4usenet

more correctly, opening saved copy of workbook, replaces first template
workbook. This happens only once per session.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top