OpenText Method with Excel from Progress

make

Member
Hi there,

i have wrote a little program wich opens a txt file in Excel, using the opentext method.
But i dont know how i can set the datatype of the created fields in Excel from the Standard-format to the Textformat. There is an parameter in the open text method i believe, but i dont know wich one.

Thanks for you help !!!

Make

Here is my code :

FOR EACH bstuebrw WHERE bstuebrw.statSeq = statisti.statSeq NO-LOCK
BY bstuebrw.lk-nr:
ASSIGN C-WIN {&WINDOW}:TITLE = "Exportiere : ..." + string(artikel_nr).
process events.
export stream strOut Delimiter '~t' substring(bstuebrw.artikel_nr,1,2) substring (bstuebrw.artikel_nr,4,3)~
substring(bstuebrw.artikel_nr,8,4) substring(bstuebrw.artikel_nr,12,5)~
substring(bstuebrw.artikel_nr,17,5) substring(bstuebrw.artikel_nr,22,5)~
substring(bstuebrw.artikel_nr,27,1) string(bstuebrw.artikel_bez)~
string(BestMenge) string(Liefmenge) string(offnmenge)~
string(Bestnr) string(posnr) string(Bestdat) string(datum) string(Lvon) ~
string(LBis) string(Gvon) string(Gbis) string(statisti.vondatum) string (statisti.bisdatum).
end.
output stream strOut close.
CREATE "Excel.Application" chExcelApplication NO-ERROR.
IF ERROR-STATUS:ERROR THEN RETURN no-apply.
chExcelApplication:DisplayAlerts = FALSE.
chExcelApplication:DisplayAlerts = FALSE.
chExcelApplication:Interactive = FALSE.
chExcelApplication:Visible = TRUE.
chExcelApplication:Workbooks:OpenText(outfile,{&xlWindows},,,, TRUE).
chExcelApplication:DisplayAlerts = TRUE.
chExcelApplication:Interactive = TRUE.
RELEASE OBJECT chExcelApplication NO-ERROR.
chExcelApplication = ? NO-ERROR.

 

bendaluz2

Member
You are correct by the look of it

Code:
(Method with 14 arguments, 9 optional)

NO-RETURN-VALUE <com-handle>: OpenText ( 
	  Character-Filename,
	  <anytype>-Origin,
	  <anytype>-StartRow,
	  <anytype>-DataType,
	  Integer-TextQualifier,
	  <anytype>-ConsecutiveDelimiter,
	  <anytype>-Tab,
	  <anytype>-Semicolon,
	  <anytype>-Comma,
	  <anytype>-Space,
	  <anytype>-Other,
	  <anytype>-OtherChar,
	  <anytype>-FieldInfo,
	  <anytype>-TextVisualLayout ).

Originally posted by make
Hi there,

i have wrote a little program wich opens a txt file in Excel, using the opentext method.
But i dont know how i can set the datatype of the created fields in Excel from the Standard-format to the Textformat. There is an parameter in the open text method i believe, but i dont know wich one.

Thanks for you help !!!

Make

Here is my code :

FOR EACH bstuebrw WHERE bstuebrw.statSeq = statisti.statSeq NO-LOCK
BY bstuebrw.lk-nr:
ASSIGN C-WIN {&WINDOW}:TITLE = "Exportiere : ..." + string(artikel_nr).
process events.
export stream strOut Delimiter '~t' substring(bstuebrw.artikel_nr,1,2) substring (bstuebrw.artikel_nr,4,3)~
substring(bstuebrw.artikel_nr,8,4) substring(bstuebrw.artikel_nr,12,5)~
substring(bstuebrw.artikel_nr,17,5) substring(bstuebrw.artikel_nr,22,5)~
substring(bstuebrw.artikel_nr,27,1) string(bstuebrw.artikel_bez)~
string(BestMenge) string(Liefmenge) string(offnmenge)~
string(Bestnr) string(posnr) string(Bestdat) string(datum) string(Lvon) ~
string(LBis) string(Gvon) string(Gbis) string(statisti.vondatum) string (statisti.bisdatum).
end.
output stream strOut close.
CREATE "Excel.Application" chExcelApplication NO-ERROR.
IF ERROR-STATUS:ERROR THEN RETURN no-apply.
chExcelApplication:DisplayAlerts = FALSE.
chExcelApplication:DisplayAlerts = FALSE.
chExcelApplication:Interactive = FALSE.
chExcelApplication:Visible = TRUE.
chExcelApplication:Workbooks:OpenText(outfile,{&xlWindows},,,, TRUE).
chExcelApplication:DisplayAlerts = TRUE.
chExcelApplication:Interactive = TRUE.
RELEASE OBJECT chExcelApplication NO-ERROR.
chExcelApplication = ? NO-ERROR.

 
Top