var
XlsObj : OleVariant;
BookObj : OleVariant;
SheetObj : OleVariant;
begin
XlsObj := CreateOleObject('Excel.Application');
XlsObj.DisplayAlerts := false; // prevent warnings from popping up
BookObj := XlsObj.Workbooks.Open(XlsFileName,,true); // readonly
SheetObj := BookObj.Sheets[SheetName];
do_some_work;
BookObj.Close(false);
end;
I am a full-time consultant and provide services related to the design, implementation and deployment of mathematical programming, optimization and data-science applications. I also teach courses and workshops. Usually I cannot blog about projects I am doing, but there are many technical notes I'd like to share. Not in the least so I have an easy way to search and find them again myself. You can reach me at erwin@amsterdamoptimization.com.
Sunday, June 15, 2008
Reading Excel Spreadsheets from Delphi
The basic code looks like:
Subscribe to:
Post Comments (Atom)
Thanks buddy!!
ReplyDeleteIt helped me, else I was getting exception like excel automation. Can you just elaborate that what does false mean in close function?