Working With Other Workbooks And Files

You can use the following parameters with the OpenText method to open a text file as a workbook.

PARAMETERS

DESCRIPTION

FileName

Name and location of the text file.

Origin

Use xlMacintosh, xlWindows, or xlIMSDOS to indicate the original file platform.

StartRow

First row to use from the text file.

DataType

The type of data in the text file, either xlFixedWidth or xlDelimited.

TextQualifier

The character that identifies text. Use xlTextQualifiedDoubleQuote, xlTextQualifierNone, or xlTextQualifierSingleQuote.

ConsecutiveDelimiter

Type True to treat consecutive delimiters as one.

Tab, Semicolon, Comma, Space

Type True if the character is the delimiter.

Other, OtherChar

Type True for Other if you specify a different delimiter for OtherChar.

FieldInfo

Column number followed by a XlColumnDataType constant (see Appendix A for constants).

TextVisualLayout

Visual layout of the text.

DecimalSeparator, ThousandsSeparator

Characters indicating decimal and thousands location.

TrailingMinusNumbers

Character that indicates minus numbers.

Local

True saves the file in the Excel language. False saves the file in the VBA language.

■ You can type a comma and a space and then type optional parameters that you want to include with the OpenText method.

■ The specified text file opens in a workbook format.

< Type FileName:="TextFile", replacing TextFile with the name of the text file.

-Q Type Tab:=True, followed by a comma.

Type Thousands Separator:=",".

■ You can type a comma and a space and then type optional parameters that you want to include with the OpenText method.

■ The specified text file opens in a workbook format.

0 0

Post a comment