ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2007 save compatibility issue (https://www.excelbanter.com/excel-programming/389332-excel-2007-save-compatibility-issue.html)

Sarang[_2_]

Excel 2007 save compatibility issue
 
Hi All,

I've been running into saving the excel workbook in compatibilty mode
issues with automation.

Steps a

Open Excel 2007:
Now i go to the office button on the top left and set the options to
save in office 97-2003 format.

Now you cannot add more than 256 columns of data.

close the Excel.


Automation code with me something like this:

CLSID clsid;
HRESULT h = CLSIDFromProgID(L"Excel.Sheet", &clsid);

// some more stuff here

h = ::OleCreate(clsid, IID_IOleObject, OLERENDER_NONE, NULL, site,
context-storage, (void **) &oleObject);

// some more stuff here

h = ::OleRun(oleObject);

oleObject-DoVerb(OLEIVERB_OPEN, NULL, context-site, 0, NULL, NULL);


This will bring up the Excel 2007 and set it running.


Now if you check the save options it will still show the saving format
at .doc but will gladly allow you to add more than 256 columns of
data.
And now if you save it will not save in .doc format.


Please let me know if I'm missing something here.


Thanks in advance,
Sarang Baheti.


Sarang[_2_]

Excel 2007 save compatibility issue
 
On May 14, 12:00 pm, Sarang wrote:
Hi All,

I've been running into saving the excel workbook in compatibilty mode
issues with automation.

Steps a

Open Excel 2007:
Now i go to the office button on the top left and set the options to
save in office 97-2003 format.

Now you cannot add more than 256 columns of data.

close the Excel.

Automation code with me something like this:

CLSID clsid;
HRESULT h = CLSIDFromProgID(L"Excel.Sheet", &clsid);

// some more stuff here

h = ::OleCreate(clsid, IID_IOleObject, OLERENDER_NONE, NULL, site,
context-storage, (void **) &oleObject);

// some more stuff here

h = ::OleRun(oleObject);


Actually here the launching Excel process fails with error code
0x80030002(STG_E_FILENOTFOUND)
Also I'm trying to open a xlsx file thru structured storage file. Is
this valid?

This code works perfectly fine on machine where Excel2007 is installed
and I'm trying to run Excel2007 workbook thru OleRun.

Also I have installed compatibility pack on top of Office 2003 so that
it opens any of Office2007 files correctly.


oleObject-DoVerb(OLEIVERB_OPEN, NULL, context-site, 0, NULL, NULL);

This will bring up the Excel 2007 and set it running.

Now if you check the save options it will still show the saving format
at .doc but will gladly allow you to add more than 256 columns of
data.
And now if you save it will not save in .doc format.

Please let me know if I'm missing something here.

Thanks in advance,
Sarang Baheti.





All times are GMT +1. The time now is 12:19 AM.

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