[Migrated content. Thread originally posted on 15 April 2005]
Hello,i have to import nearly 15.000 data-records into excel from serveral vision-files.
first test:
a direct import into excel
result:
the programm runs 5 hours and then crash with error "not enough memory".
second test:
direct import into excel and save Workbook every 500 data-records (hope that less memory is needed)
result:
same as first test.
third test:
import to a text-file, open it with excel
Problem:
text-lines with "=" at beginning
Solution:
define the Columns as "Text"
So i created a macro in Excel to see how i have to write it:
Workbooks.OpenText Filename:="C:\\muffrohr\\SEQ-ART.TXT", Origin:=xlMSDOS, _
StartRow:=1, DataType:=xlDelimited, TextQualifier:=xlNone, _
ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=True, Comma:=False _
, Space:=False, Other:=False, FieldInfo:=Array(Array(1, 1), Array(2, 1), _
Array(3, 1), Array(4, 1), Array(5, 1), Array(6, 2), Array(7, 2), Array(8, 2), Array(9, 2), _
Array(10, 1), Array(11, 1), Array(12, 1), Array(13, 1), Array(14, 1), Array(15, 1), Array( _
16, 1), Array(17, 1), Array(18, 1), Array(19, 1), Array(20, 1), Array(21, 1), Array(22, 1)) _
, TrailingMinusNumbers:=True
And here is my Problem:
how must i write in Cobol the FieldInfo?
Without FieldInfo i can open the TextFile:
modify xls-app WORKBOOKS::OpenText(
by name FileName "c:\\muffrohr\\seq-art.txt",
by name Origin xlMSDOS,
by name StartRow 1,
by name DataType xlDelimited,
by name TextQualifier xlNone,
by name ConsecutiveDelimiter 0,
by name Tab 0,
by name Semicolon 1,
by name Comma 0,
by name Space 0,
by name Other 0,
by name TrailingMinusNumbers 1
)
giving xls-book.
FieldInfo i have no Idea how to write it...
modify xls-app WORKBOOKS::OpenText(
by name FileName "c:\\muffrohr\\seq-art.txt",
by name Origin xlMSDOS,
by name StartRow 1,
by name DataType xlDelimited,
by name TextQualifier xlNone,
by name ConsecutiveDelimiter 0,
by name Tab 0,
by name Semicolon 1,
by name Comma 0,
by name Space 0,
by name Other 0,
by name FieldInfo array(1, 1),
array(2, 1),
array(3, 1),
array(4, 1),
array(5, 1),
array(6, 2),
array(7, 2),
array(8, 2),
array(9, 2),
array(10, 2),
array(11, 2),
array(12, 1),
array(13, 1),
array(14, 2),
array(15, 1),
array(16, 2),
array(17, 1),
array(18, 2),
array(19, 1),
array(20, 2),
array(21, 1),
array(22, 1),
by name TrailingMinusNumbers 1
)
giving xls-book.
array is unknow, without array it don't work, tested several variant with
call "C$SETVARIANT" using "...", h-fieldinfo.
But nothing worked :(
Any have an idea how the correct syntax is?
Regards
David Neidinger
PS: sorry for my bad english



