Importing to access - docmd.transferspreadsheet acspreadsheet parameter

Peejay16

New Member
Joined
Aug 1, 2011
Messages
3
I'm sure this has been asked before but I couldn't find anything on a search so please bear with me. I'm writing an access db for a charity, and part of the process means an import from an excel worksheet. I've written the import using the docmd.transferspreadsheet command and the acSpreadsheetTypeExcel8 parameter and it works fine. My concerns is that I can see the use of this parameter causing an issue in the future as PCs get upgraded to later versions of software. I appreciate I can't future proof it completely but what I'd like to do if possible is find out the spreadsheet 'version' (i.e. what file format it's saved in, excel 97-2003 etc) as part of the procedure and then use that to ensure I get the right parameter later on. Can anyone point me in the right direction to do this? Thanks
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Thanks Bob. As you say it works but I'm still a little unsure of whether that will cause an issue anywhere. Seems strange there is no property you can retrieve in Excel to say what format a sheet is saved using?
 
Upvote 0
Thanks Bob. As you say it works but I'm still a little unsure of whether that will cause an issue anywhere. Seems strange there is no property you can retrieve in Excel to say what format a sheet is saved using?

The thing is, that you don't need to specify which format it is when importing. Now, exporting would be different in that you can decide which format to use. But importing, Access will be able to tell just fine what it needs to know if it is an Excel file.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,672
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top