Page 159 - Microsoft Office Excel 2003 Programming Inside Out
P. 159
Part 3: The Excel Object Model
Workbooks and Worksheets
Table 7-2. Parameters Available with the Workbooks.OpenText
Method
Parameter Description Chapter 7
FileName Required string specifying the name and path of the file.
Origin Indicates the operating system used to create the file. The three con;
stants are xlWindows, xlMacintosh, and xlMSDOS. If this parameter
isn’t specified, Excel uses the current operating system.
StartRow The number of the row from which Excel should begin reading
data into the worksheet.
DataType Specifies the column format of the data in the file using one of
the following XlTextParsingType constants: xlDelimited, which
indicates there is a delimiting character, or xlFixedWidth, which
indicates each field is of a fixed length. If this argument is not
specified, Excel attempts to determine the column format when it
opens the file.
TextQualifier Uses an XlTextQualifier constant to indicate the character used to
indicate that a field contains a text value. The available constants
are xlTextQualifierDoubleQuote (double quotes, the default),
xlTextQualifierNone (no character indicates a field contains text),
and xlTextQualifierSingleQuote (single quotes).
ConsecutiveDelimiter Set these parameters to True if you want to treat two or more
consecutive delimiter characters as a single cell boundary.
Tab, Semicolon, Set this parameter to True if the named character is the delimiter
Comma, Space used in the text file.
FieldInfo An array containing parse information for individual columns of
data. When the data is delimited, this argument is an array of two-
element arrays, with each two-element array specifying the
conversion options for a particular column. The first element is
the column number (1-based), and the second element is one of
the xlColumnDataType constants specifying how the column is
parsed. Those constants are xlGeneralFormat (a General value),
xlTextFormat (a Text value), xlMDYFormat (an MDY date),
xlDMYFormat (a DMY date), xlYMDFormat (a YMD date),
xlMYDFormat (an MYD date), xlDYMFormat (a DYM date),
xlYDMFormat (a YDM date), xlEMDFormat (an EMD date), and
xlSkipColumn. (Do not import the column.) You can use
xlEMDFormat only if you have installed and selected Taiwanese
language support. The xlEMDFormat constant specifies that
Taiwanese era dates are being used.
TextVisualLayout A variant, not used in the American English version of Excel, that
controls how the workbook is displayed within the Excel interface.
continued
133