Importing Access query to Excel

  • Thread starter Thread starter bhu
  • Start date Start date
B

bhu

Using a query from access it is imported to excel file.

For only one user it fails at this line
DoCmd.TransferSpreadsheet 1, 8, "dbo." & QuerySending, SavedName, True,
"InputRange"

Error which is shown when executable is executed is
The file is not in recognizable format.

he has office 2003 installed in his system, but i do see office12 folder.
Please let me know what is the cause of the problem?
 
It appears you'll need to develop for both versions. I have no
experience with this, but you might use a variable for the spreadsheet
type argument. You might populate the variable by determining the
excel version.

I found this on microsoft.public.excel

Newsgroups: microsoft.public.excel
From: "CLR" <[email protected]>
Date: Tue, 30 Nov 2004 21:24:29 -0500
Local: Tues, Nov 30 2004 6:24 pm
Subject: Re: Excel Version in VBA

Someone in the group gave me this a while back when I had 4 versions
of
excel on my computer and couldn't remember which one I had
open...........it
puts the "version" in the upper title bar..........

Sub Auto_open()
With Application
Select Case Val(.Version)
Case 10: .Caption = .Name & " 2002"
Case 9: .Caption = .Name & " 2000"
Case 8: .Caption = .Name & " 97"
Case 7: .Caption = .Name & " 95"
End Select
End With
End Sub



- Hide quoted text -
- Show quoted text -
Is there a way, using VBA, to determine the version of Excel that is
running?

HTH

Dan
 
Back
Top