P115 Import Tables from Documents (doc, htm, rtf, xml etc.)

/P#

Meaning

Extra Parameters: /1{Parameter1} … /n{Nth Parameter}

115

Import tables from doc, html, xml, rtf, wpd etc into an Excel worksheet(s)/workbook(s)

/1 = sTablesToImport (i.e. “1,3-5”)

/2 = lTableImportMethod: Valid values (0,1,2)

/3 = sSheetToImportTo

/4 = sPasteToCell

/5 = lRowsBetweenTables

/6 = lColsBetweenTables

/7 = sRowsToDelete

/8 = sColsToDelete

/9 = bRemoveFormatting

This special process can import tables from any file MS Word can open which includes DOC, HTML, XML, RTF, WPD etc.

Special Parameters Described in Detail

/1 = sTablesToImport Here you want to specify which tables you want to import. To import tables 1 3,4 and 5 use “1,3-5”. To import all tables use the asterisk “*” character (i.e. “/1*” ).

/2 = lTableImportMethod: Valid values (0,1,2)

There are 3 methods to import the table into MS Excel. First choice, 0, is to import to a specified sheet. All tables specified will be copied to the same sheet with this option. Second choice, 1, is to create a new sheet for each table chosen to be imported. The names of the sheets will be based on the “Target Sheet Name or Number” specified. The last option, 2, allows you to create a new workbook file for each table specified. The output file name in this case is based on the input file and table numbers specified.

/3 = sSheetToImportTo Specify the name or number of the sheet to import the tables to.

/4 = sPasteToCell Specify the starting cell to begin pasting the tables into (i.e. “B3”)

/5 = lRowsBetweenTables Row Offset between each table: /5 and /6 are only relevant for when you’ve specified to copy more than one table into a single sheet (e.g. /2 0). To place each table 2 rows below the last tables data, specify “/5 2” and don’t use /6. To place each table 3 columns to the right of each other don’t use /5 and specify “/6 3”. Specify a value of 0 for /5 or /6 to make the data contiguous (no spacing between tables).

/6 = lColsBetweenTables Column offset between each table. See /5 for details.

/7 = sRowsToDelete Remove Rows: You may not want the first row (very common) of each table being imported. So you can easily specify any combination of rows or columns you want removed from the table when being imported. To remove rows 1, 4, 5 and 6 specify “/7 1,4-6” for example. To remove the 2nd column use “/8 2”

/8 = sColsToDelete See /7 for an explanation.

/9 = bRemoveFormatting Set to TRUE to only copy table data: Here you may only copy the textual content of the table and ignore any formatting the input file had. Set to FALSE to retain formatting etc.

Examples:

Example 1: Import One or More Tables into a Single Sheet

Example 2: Import One Or More Tables into One or More New Sheets

Example 3: Import one Or More Tables into One or More Workbooks