Absent Member.
Absent Member.

Passing FieldInfo to TextToColumns

Trying to convert an Excel column containing fixed width text to columns using COM server.

How to pass FieldInfo?


           invoke ExcelObject "getRange" using z"A:A" returning CellRange.

           invoke olesup "setNamedParameters" using by value 1 size 3

           invoke CellRange "TextToColumns" using

                                         by reference z"Destination"

                                         by value CellRange

                                         by reference z"DataType"

                                         by value xlFixedWidth

                                         by reference z"FieldInfo"

                                         by reference w-field-info.


What I am trying to do looks like this in VBA:


    Selection.TextToColumns Destination:=Range("A1"), DataType:=xlFixedWidth, _

        FieldInfo:=Array(Array(0, 1), Array(4, 1), Array(8, 1), Array(52, 1), Array(56, 1), _

        Array(67, 1), Array(107, 1)), TrailingMinusNumbers:=True

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.