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 

Adding Workbooks in Excel

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
Alton Chinn
Guest





PostPosted: Sat Nov 22, 2003 2:01 am    Post subject: Adding Workbooks in Excel Reply with quote



Why is that code that compiles generate errors such as:

Old format or invalid type library?

This code is compiled in Delphi 5 on a Windows2000 desktop (no
apparent Win95 issues):

procedure TfrmMain.Export_it(in_dataset: TDataset);
var rangestart, rangeend, varfilename: olevariant;
vartemplate: olevariant;
myworkbook: TExcelWorkbook;

begin
rangestart := 'A1';
rangeend := 'A1';
varfilename := 'c:temptest.xls';
MyExcel.Connect;
MyExcel.Workbooks.Add(emptyparam,1); //generates "old format" error
here
MyExcel.range[rangestart, rangeend].Value := 'Account No.';
MyExcel.ActiveWorkbook.SaveAs(varfilename,EmptyParam,EmptyParam,EmptyParam,
EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,1);

MyExcel.Disconnect;
end;

Alton in San Francisco
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation 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.