Export Qry to excel - data mismatch error

ppoindexter

Registered User.
Local time
Today, 03:22
Joined
Dec 28, 2000
Messages
134
the following code

DoCmd.TransferSpreadsheet acExport, "qryMonthlyStatusReport_Active", "C:\AccessExport.Active.xls"

produces the error

Runtime error 13
Type Mismatch


i am 2003 versions of access and excel

please help
thanks
 
Try using;

Code:
"C:\AccessExport_Active.xls"

It shouldn't matter, but worth a check. Also, can you give a quick list of the fields and their data types in qryMonthStatusReport_Active?
 
I thinkl you miised a comma in there
DoCmd.TransferSpreadsheet acExport,, "qryMonthlyStatusReport_Active", "C:\AccessExport.Active.xls"

peter
 
thanks for you replies

thanks to both of you for replying
dont mean to be ignoring your replies
i am in the middle of a war over here in iraq
and we had a bad day yesterday

i tried the code you provided but now i get

Run-time error ‘3051’
It is already opened exclusively by another user, or you need permission to view its data.

we have a lot of security on our computers could that be the problem?
- i am signed on as a user
- the path is to my hard drive
- the file is not open
any ideas
thanks
 
Security

Definitely sounds like a permissions/security issue as the code set by BAT17 looks good.

Be safe.
 
It sounds more like an Access security problem than an Excel one.
Try doing it to another file name to see if it will create an excel file OK.

DoCmd.TransferSpreadsheet acExport,, "qryMonthlyStatusReport_Active", "C:\xyz.xls"

Peter
 
i get the same error
i assume its a userlevel security issue
i will just have em export the data using file - export
thanks for trying
merry christmas
 
look at the properties for the query, there is an option along the lines of "owners Permmisions" this will should let the query run. search MS for RWOP

HTH

Happy Christmas to you too :) Time for turkey here now

Peter
 

Users who are viewing this thread

Back
Top Bottom