Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RunSavedImportExport - How to Change Path, or How to TransferSpreadsheet?

Status
Not open for further replies.

MattGreer

Technical User
Feb 19, 2004
471
US
I have an Excel (xlsb, Office 365) spreadsheet that I'm using to import data to Access. This command works quite well:

Code:
DoCmd.RunSavedImportExport "ImportForecastData"


Unfortunately, the location of the database and excel file will change, thus breaking the saved Import.

I tried to import the spreadsheet as follows, but I was unable to specify the specific table in the Excel file to use. How can I point to the named Excel table?

Code:
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel12, varTable, varName, True, "DailyData"

Thanks!!


Matt
 
There is a range parameter to transferspreadsheet... I would expect you could put your table or named range in there too...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top