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 

TExcel Application: Excel XP -> Excel 2007

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






PostPosted: Mon Apr 02, 2007 9:06 pm    Post subject: TExcel Application: Excel XP -> Excel 2007 Reply with quote



Hi

I´m using TExcelApplication to generate a differents .xls from a
template. I have migrate to Excel 2007. I have updated the templates
from.xls to .xlsm. I generate differents files with new data.

ExcelApplPool->Connect();
// Open template
wb=ExcelAppl->Workbooks->Open(wfPath.c_bstr());
// Get specific sheet
ws=wb->get_Sheets()->get_Item(numSheet);
ws->Unproctect(&TVariant(WideString(TKM_PASSWORD)));

// Rename
ws->setName(WideString(listCategoryName);

// Write data
(ws->get_Range("N4"))->set_Value(WideString(listCategoryName));
...............................

ws->Protect(&TVariant(WideString(TKM_PASSWORD)));
ws->SaveAs(xlsPath.c_bstr());
wb->Close();
ExcelApplPool->Quit();
ExcelApplPool->Disconnect();

With Excel XP is working correctly but with Excel 2007 doesn´t work.
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.