O'Reilly logo

Programming Excel with VBA and .NET by Steve Saunders, Jeff Webb

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required