I have made a report witch is generating multiple excel sheets. One of those have to filled up with data from a text file. I record a macro how to arrange this and found the function XlQueryTables. One of the parameters called TextFileColumnDataTypes caused problems because i don't know how to fill or to use this. In vba the parameter is filled up with an Array (type variant) like:
xlQueryTable.TextFileColumnDataTypes := Array(1,1,1,1,1); //5 Columns of type 1
Is there anybody who knows how to fill this parameter? I've already tried to do this with a variant variable, it compiles but arrange an error by processing the report. I also tried to use dimensions on different kinds of variables bud no luck at all....
Thanks in advance for your helpful replies... :thumbsup:
0
Comments
first solution: use a dataport to read the file and to put it in a table, then read the table and flush it to excel through excel buffer...it's relatively easy and fast to implement (depending on the tasks you have to do with the data).
second solution: read the file through a custom routine, split it up and put the values in different variables, then write an excel line. It's somewhat long to implement, but you don't need a table.
P.S.: there's a way to work with first solution without sparing a table object in customer license, but it's long to explain...if you want to know more, just ask me: it implies the use of temporary tables
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
Thank for you reply. I know the functionality of tempoerary tables, and the use of the runtime textfile downunder the temporarytable. I don't have any problem with creating the Excel sheets. My problem is that i have a seperate txt file and a few of other excel sheets with navision data on it. I need to open this txt file. Yes i can do this and use a text function bud it is costs to much time to render this. The excel function i want to use can handle 100000 of records in just a few seconds. Thats why i want a solution for this issue.
Extra Information:
Excel give me some extra information (F5) over this property:
[VARIANT TextFileColumnDataTypes :=] xlQueryTable.TextFileColumnDataTypes([VARIANT TextFileColumnDataTypes])
Here, lScript is an Automation of type 'Microsoft Script Control 1.0'.ScriptControl
Everything else is clear, i believe.