I am using the TExcelApplication component to send data into an Excel
workbook. Using the early binding (VTable) interface, I dropped the
TExcelApplication object onto my form and can get an instance of Excel just
by calling a method. For example,
TForm1 = class(TForm)
...
MyExcelApp: TExcelApplication;
...
private
public
end;
procedure TForm1.Button1Click(Sender: TObject);
var
NumOfWorkbooks:Integer;
begin
NumOfWorkbooks:= MyExcelApp.Workbooks.Count;
with MyExcelApp do
begin
...
end;
end;
. Anybody, any though?
Raymond Chow
myExcelApp:= ExcelApplication.Workbooks.Count;
I can use myExcelApp and the Excel object model to do the automation. My
question is that when my program is done, do I need to release myExcelApp?
Currently my program just quit without releasing myExcelApp. My hope is
that TExcelApplication is just like any other object (e.g. TForm) that
Delphi will destroy when my program quits. However, I am worry that my
program may leak memory by not taking care of MyExcelApps!
Also, what is the purpose of lcid?
Raymond Chow
Yes, you do. If you don't want Excel to continue running,
you need to call its Quit method; and you also need to
Disconnect every Excel component you use, or Excel is
likely to keep running invisibly even after the Quit.
LCIDs are locale identifiers. Locale can be quite important
in Excel, since it affects number format (thousand
separators, etc) date format, currency signs, etc.
--
Deborah Pate (TeamB) http://delphi-jedi.org
Use Borland servers; TeamB don't see posts via ISPs
http://www.borland.com/newsgroups/genl_faqs.html
As for the LCIDs, if my program is just for local use, can I just use zero
anytime a method requires a LCID?
Raymond Chow
"Deborah Pate (TeamB)" <d.p...@cableinet.co.not-this-bit.uk> wrote in
message news:VA.0000087...@cableinet.co.not-this-bit.uk...
Yes, it's usually fine.