ACCESS EXPORT TO EXCEL

Public Function ExporttoExcel()
DoCmd.TransferSpreadsheet acExport, , "tblExportFile", , "C:\ADP\PCPW\ADPDATA PRWBBEPI.XLS", False



End Function

WHEN I RUN THIS FUNTCTION I GET THE ERROR MESSAGE "AN EXPRESSION YOU ENTERED
IS THE WRONG DATA TYPE FOR ONE OF THE ARGUMENTS" PLEASE HELP
s
Serena2345Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pdebaetsCommented:
Try this:

DoCmd.TransferSpreadsheet acExport, , "tblExportFile",  "C:\ADP\PCPW\ADPDATA PRWBBEPI.XLS", False
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jeffrey CoachmanMIS LiasonCommented:
Yes, if you create your expression in  the VBA editor, you can always right click the keyword (for ex." Transferspreadsheet") and select "Quick info" from the shortcut menu.

Likewise you can always click on a keyword and press the F1 Function key to bring up the help file on the selected word.
0
Serena2345Author Commented:
It does not create the file
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

pdebaetsCommented:
Do you have records in the table "tblExportFile"?
0
Jeffrey CoachmanMIS LiasonCommented:
Make sure you are going to that specific location to see if the file is there:
    C:\ADP\PCPW\ADPDATA PRWBBEPI.XLS
0
Serena2345Author Commented:
Thanks for the help boag,you were right I was missing a "\" in the path
pd thanks for the transfer spreadsheet
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.