Use the transferspreadsheet Method Example The following example imports the table to the "employees" table of Microsoft Access within the specified range of the lotus workbook newemps. wk3 and uses the first row of the workbook as the field name. Docmd. transferspreadsheet acimport, 3 ,_ "Employees", "C:/Lotus/newemps. wk3", true, "A1: G12" In Visual Basic, The transferspreadsheet method performs the transferspreadsheet operation. Expression. transferspreadsheet (transfertype, spreadsheettype, tablename, filename, hasfieldnames, range, useoa) Expression is required. Returns the expression of an object in the "applies to" list. Transfertype is optional. Acdatatransfertype can be one of the following acdatatransfertype constants: Acexport Acimport default Aclink If you leave this parameter blank, the default constant (acimport) is used ). Spreadsheettype is optional. Acspreadsheettype can be one of these acspreadsheettype constants: Acspreadsheettypeexcel3 Acspreadsheettypeexcel4 Acspreadsheettypeexcel5 Acspreadsheettypeexcel7 Acspreadsheettypeexcel8 default Acspreadsheettypeexcel9 default Acspreadsheettypelotuswj2-Japanese version only Acspreadsheettypelotuswk1 Acspreadsheettypelotuswk3 Acspreadsheettypelotuswk4 Note that you can link the data in the Lotus 1-2-3 workbook file, but the data is read-only in Microsoft Access. You can import data from and link to the Lotus. wk4 file, but you cannot export Microsoft Access Data to this spreadsheet format. Microsoft Access no longer supports using this method to import, export, or link to the workbook data of Lotus. wks or Microsoft Excel 2.0. If you leave this parameter blank, the default constant (acspreadsheettypeexcel8) is used ). Tablename is of the variant type. String expression, which indicates the name of the Microsoft Access Table to which you want to import, export, or link workbook data, alternatively, you can select the query name for Microsoft Access to export the results to the workbook. Filename is of the variant type. String expression, indicating the name and path of the workbook from which you want to import, export, or link. Hasfieldnames can be of the variant type. Use true (-1) to use the first row of the workbook as the field name when importing or linking. Use false (0) to treat the first row of a data table as normal data. If this parameter is left blank, the default value (false) is used ). When you export a Microsoft Access Table or SELECT query data to a workbook, the field name is inserted into the first row of the workbook regardless of the value entered for this parameter. Range is optional. String expression, indicating the valid range or range name of cells in the workbook. This parameter can only be used for import. To import the entire workbook, leave this parameter blank. This parameter must be left blank when exporting to a workbook. If a range is entered, the export fails. Useoa can be of the variant type. Description For more information about how to use this operation and its parameters, see the topic of this operation. Optional parameters in the syntax can be left blank, but must contain commas. If you leave the parameter at the end blank, you do not need to use a comma after the specified last parameter. Note that ActiveX Data Objects (ADO) can also be used to create links. The method is to use the activeconnection attribute of the recordset object. |