tinpoppy@yahoo.com Guest
|
Posted: Fri Aug 19, 2005 4:56 pm Post subject: Opentext Problem in Delphi |
|
|
Hi,
I'm trying to open a csv file from within Excel. I'm using the
OpenText command from within my Delphi project to do it. I only want
to
format one of the fields in the file as text (Column 5). If I don't,
Excel tries to format it as a number.
Here's my code:
xl := CreateOLEObject('Excel.application');
xl.Visible := True;
xl.Workbooks.OpenText(sFileOut, Origin:=437, StartRow:=1,
DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote,
ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=True, Space:=False,
Other:=False, FieldInfo:=Array(Array(5, 2)));
This isn't working because I don't have the "Array" piece stated
correctly. Does anyone know how to state it correctly?
Thanks.
|
|