Solved

Dynamically Determine the SpreadsheetType value in DoCmd.TransferSpreadsheet Method

Posted on 2014-04-23
1
4,393 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

617 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