Name

workbooks.OpenText(Filename, [Origin], [StartRow], [DataType], [TextQualifier], [ConsecutiveDelimiter], [Tab], [Semicolon], [Comma], [Space], [Other], [OtherChar], [FieldInfo], [TextVisualLayout], [DecimalSeparator], [ThousandsSeparator], [TrailingMinusNumbers], [Local])

Synopsis

Opens a text file and interprets it as a workbook. How OpenText interprets the text file is determined by the method’s many arguments.

Argument

Settings

Filename

The text file to open.

Origin

The platform to create the text file; can be one of the following xlPlatform settings: xlWindows, xlMSDOS, xlMacintosh. The default is the current platform.

StartRow

The row within the file at which to start parsing. Default is 1 for the first row.

DataType

Determines how the columns are delimited; can be one of the following xlTextParsingType settings: xlDelimited or xlFixedWidth. If omitted, Excel tries to determine the correct setting.

TextQualifier

Determines how text values are identified; can be one of the following xlTextQualifier settings: xlTextQualifierDoubleQuote (default), xlTextQualifierNone, xlTextQualifierSingleQuote.

ConsecutiveDelimiter

True parses consecutive delimiters as indicating a single column; False parses consecutive delimiters as multiple, empty columns. Default is False.

Tab

True parses the tab character as the column delimiter; False does not.

Semicolon

True parses the semicolon as the column delimiter; False does not.

Comma

True parses the comma ...

Get Programming Excel with VBA and .NET now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.