Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / May 2007

Tip: Looking for answers? Try searching our database.

TransferSpreadsheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
chippy2 - 04 Mar 2007 13:08 GMT
Hi all

I have an application in Access 97 that uses DoCmd.TransferSpreadsheet to
get data from an Excel spreadsheet into a table. This has worked quite
happily with Excel 2000 spreadsheets for several years but the supplier of
the spreadsheets, who is completely outside my and my customer’s control, has
upgrade their version of Excel (guess it’s gone to 2003 or 2007) and the
Access TransferSpreadsheet method no longer recognises the format. I’ve tried
using DAO instead, but Access 97 has no ISAM to handle the connection. Short
of making my immediate customer go through the nausea of saving the
spreadsheets in an older format every day, does anyone know of a fix (like an
ISAM for Access 97 to connect to the newer version of Excel)?

Any advice would be much appreciated.

Chip
chippy2 - 07 Mar 2007 13:27 GMT
If anyone's interested I cracked this by using the Excel object model from
VBA within Access to load each spreadsheet and SaveAs an earlier version of
Excel.
Arman - 24 May 2007 22:55 GMT
Hi chippy2, could you give an example of your VBA code?

Thanks.

> If anyone's interested I cracked this by using the Excel object model from
> VBA within Access to load each spreadsheet and SaveAs an earlier version of
> Excel.
chippy2 - 24 May 2007 23:32 GMT
Hello. What follows is not a complete solution (e.g. you have to cater for
what happens if Excel is already open and you need to provide a full path to
the workbook location), but the salient bits are:

Dim excl As Excel.Application
Set excl = CreateObject("Excel.Application")
excl.Workbooks.Open "workbook.xls"
excl.ActiveWorkbook.SaveAs "tmp.xls"
Kill "workbook.xls"
excl.ActiveWorkbook.SaveAs FileName:="workbook.xls",
FileFormat:=xlExcel9795, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, CreateBackup:=False
excl.ActiveWorkbook.Close
Kill  "tmp.xls"

> Hi chippy2, could you give an example of your VBA code?
>
[quoted text clipped - 3 lines]
> > VBA within Access to load each spreadsheet and SaveAs an earlier version of
> > Excel.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.