vba - How to specify a different file path for a saved Excel import -


I use the doCmd.TransferText to use a saved text import specification several times However, I think that I select a file to select that file from a application.FileDialog (msoFileDialogFilePicker) file Can easily save the path.

One way to do this with Excel file is to save the Excel import specification, but there is no way to use saved import using the DoCmd.TransferSpreadSheet method. There is no option to specify a file path in addition, as well as DoCmd.RunSavedImportExport .

Is there any work for this except for using any other file type (for example .csv)

CurrentProject.ImportExportSpecifications Collections are stored in the ImportExportSpecification items stored in the "saved item import" and "saved export" and "saved export" access excel import Details of something like the following XML will appear, which I manually import excel spreadsheets and the end of the import wizard "Save import steps to re page created by" checkbox Czech.

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; ImportExportSpecification Path = "C: \ User \ Guord \ Desktop \ xlsxTest.xlsx" xmlns = "XB: www.microsoft.com/office/access/imexspec" & gt; & Lt; ImportExcel first name = "true" destination = "xlsxTest" category = "sheet 1 $" & gt; & Lt; Column PrimaryKey = "ID" & gt; & Lt; Column name = "call1" field name = "id" indexed = "userplex" SkipColumn = "false" datatype = "long" /> & Lt; Column name = "call 2" field name = "textfield" indexed = "no" SkipColumn = "false" datatype = "text" /> & Lt; Column name = "call3" field name = "datefield" indexed = "no" SkipColumn = "false" datatype = "datetime" /> & Lt; / Column & gt; & Lt; / ImportExcel & gt; & Lt; / ImportExportSpecification & gt;  

ImportExportSpecification name was saved with import-xlsxTest . Now, if I change the name of the excel file from "xlsxTest.xlsx" to "another.Test.xlsx", then I import the Export SPP for the name of the file to change the name and then import the following VBA code Use:

ImportExportSpecification For more information about items, see


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -