BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

BCB6, Excel 2003 automation

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Compatibility with MFC)
View previous topic :: View next topic  
Author Message
Brian Lonnon
Guest





PostPosted: Fri Oct 20, 2006 1:24 am    Post subject: BCB6, Excel 2003 automation Reply with quote



Hi,

I need to be able to open Excel 2003 from my app, load a .xls file and save
it as an xml file. The first two parts I can do, but I can't save the file
AS in xml spreadsheet format. Can anyone help please?
Variant excel;
excel.OlePropertySet("Visible", false);
Variant book = excel.OlePropertyGet("Workbooks");
book.OleFunction("Open", OpenDialog2->FileName.c_str());
Variant application = excel.OlePropertyGet("Application");
book = excel.OlePropertyGet("Workbooks", 1);

//problems with these 2 lines
book.OlePropertySet("SaveAsType", "xlXMLSpreadsheet");
book.OleFunction("SaveAs","c:\\text1.xml");

book.OleFunction("Close");
excel.OleFunction("Quit");

Thanks

Brian
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Compatibility with MFC) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.