Importing Excel into Access 97

J

Jennie

I'm still using a Access 97 version for many reasons I won't go into, but
need help importing a later Excel version into it using VBA.
I can currently use the following code to import all but later versions of
Excel.
Can anyone point me in the right direction?
DoCmd.TransferSpreadsheet acImport, acSpreadsheetTypeExcel5, "InputData",
strInputDir, False, ""
 
J

John Nurick

Hi Jennie,

Try replacing
acSpreadsheetTypeExcel5
with
acSpreadsheetTypeExcel8
 
J

Jennie

When I use acSpreadsheetTypeExcel8 I get the error variable not defined.
I've tried re-regisering dll files (regsvr32
msexcl35.dll,msxbse35.dll,mspdox35.dll,and mstext35.dll).
Any other suggestions?
 
J

John Nurick

Hi Jennie,

My fault. In Access 97 the constant is called acSpreadsheetTypeExcel97
not acSpreadsheetTypeExcel8 (that's used in later versions).
 
J

John Nurick

I've lost track of just what you're trying to do. But either
acSpreadsheetTypeExcel97
or
acSpreadsheetTypeExcel8
should work in Access 2002 and later.
 
O

ooyn7

True. Not working. I also encoutered problems using the acImport
ac..Excel97, function. Access97 used for database development, run-tim
Access97 in setup for installation on computers. These computers us
Win2k or WinXP, no Office or Office10 (no access).

I really have no idea how to solve it, other then writing a lot o
code. There must be an easy solution - please let us know which one.

Regards,
Robi
 
Top