MrExcel Publishing
Your One Stop for Excel Tips & Solutions

a macro to download a spreadsheet into Access


Posted by Theresa on August 08, 2001 12:51 PM

I would like to do a macro to download my spreadsheet into an Access table.

Is there a way to do it?


Posted by Barrie Davidson on August 08, 2001 1:01 PM

You can create a macro in Access to do this (select the Macros tab which is right beside the Reports tab). Under the "Action" column you would select TransferSpreadsheet. You then need to fill in the arguments at the bottom of the window. They are:
Transfer Type = Import
Spreadsheet Type = Microsoft Excel 97
Table Name = "The name of the table you are importing in to"
File Name = Full path and file name of the spreadsheet
Has Field Names = Yes or No depending if your spreadsheet has field names
Range = Name of the range in the spreadsheet you are importing. Leave this blank if you want to import the entire spreadsheet.

Regards,
Barrie

Posted by Theresa on August 09, 2001 11:44 AM

Thanks Barrie, Didn't think about doing it from that direction. Worked great. Much appreicated.