Solved

Dynamically Determine the SpreadsheetType value in DoCmd.TransferSpreadsheet Method

Posted on 2014-04-23
1
3,663 Views
Last Modified: 2014-04-24
I am having to update the value of the SpreadsheetType in DoCmd.TransferSpreadsheet based on the user's version of MS Access.  

Is there a vba code to determine the SpreadsheetType value without having to hardcode it as acSpreadsheetTypeExcel3, acSpreadsheetTypeExcel9, etc ?

Thanks.
0
Comment
Question by:yvroger
1 Comment
 
LVL 119

Accepted Solution

by:
Rey Obrero earned 500 total points
ID: 40018814
xif access version is less than 12.0 , excel file extension .xls
use 8 for acSpreadsheetTypeExcel

docmd.transferspreadsheet acimport, 8,

you can also leave it blank

docmd.transferspreadsheet acimport, ,



for access version 12 and above, use 10 , excel file extension .xlsx

docmd.transferspreadsheet acimport, 10,
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now