Class TextConnection (Excel VBA)

Contains Service Contract settings that enable Microsoft Excel to connect to a Data Feed data source.

Class WorkbookConnection gives access to class TextConnection.


Dim tcn as TextConnection
Set tcn = ActiveWorkbook.Connections(1).TextConnection

Properties

Connection returns or sets a string that contains text file names that enable Microsoft Excel to connect to text data sources.

TextFileColumnDataTypes returns or sets an ordered array of constants that specify the data types applied to the corresponding columns in the text file that you are importing into a query table. The default constant for each column is xlGeneral. Read/write Variant.

TextFileCommaDelimiter true if the comma is the delimiter when you import a text file into a query table. False if you want to use some other character as the delimiter. The default value is False.

TextFileConsecutiveDelimiter true if consecutive delimiters are treated as a single delimiter when you import a text file into a query table. The default value is False.

TextFileDecimalSeparator returns or sets the decimal separator character that Microsoft Excel uses when you import a text file into a query table. The default is the system decimal separator character.

TextFileFixedColumnWidths returns or sets an array of integers that correspond to the widths of the columns (in characters) in the text file that you are importing into a query table. Valid widths are from 1 through 32767 characters.

TextFileHeaderRow returns or sets a value that specifies whether the first row (from the starting row) should be treated as a header row.

TextFileOtherDelimiter returns or sets the character used as the delimiter when you import a text file into a query table. The default value is null.

TextFileParseType returns or sets the column format for the data in the text file that you are importing into a query table.

TextFilePlatform returns or sets the origin of the text file that you are importing into the query table. This property determines which code page is used during the data import.

TextFilePromptOnRefresh true if you want to specify the name of the imported text file each time the query table is refreshed. The Import Text File dialog box allows you to specify the path and file name. The default value is False.

TextFileSemicolonDelimiter true if the semicolon is the delimiter when you import a text file into a query table, and if the value of the TextFileParseType property is xlDelimited. The default value is False.

TextFileSpaceDelimiter true if the space character is the delimiter when you import a text file into a query table. The default value is False.

TextFileStartRow returns or sets the row number at which text parsing will begin when you import a text file into a query table. Valid values are integers from 1 through 32767. The default value is 1.

TextFileTabDelimiter true if the tab character is the delimiter when you import a text file into a query table. The default value is False.

TextFileTextQualifier returns or sets the text qualifier when you import a text file into a query table. The text qualifier specifies that the enclosed data is in text format.

TextFileThousandsSeparator returns or sets the thousands separator character that Microsoft Excel uses when you import a text file into a query table. The default is the system thousands separator character.

TextFileTrailingMinusNumbers true for Microsoft Excel to treat numbers imported as text that begin with a - (minus) symbol as a negative symbol. False for Excel to treat numbers imported as text that begin with a - symbol as text.

TextFileVisualLayout returns or sets an XlTextVisualLayoutType value that indicates whether the visual layout of the text being imported is left-to-right or right-to-left.