troubleshooting Question

Export Access Table as Excel, not CSV

Avatar of marku24
marku24Flag for United States of America asked on
Microsoft Access
4 Comments1 Solution1285 ViewsLast Modified:
I have VBA code in an Access DB that exports data as a CSV file.  This code works great but I would like to export these as Excel files.  When I use the docmd.sendobject.....  the database crashes which is how I started using the .csv option.  Can I tweak this code to export these as .xlsx?  I run through a loop and pass several tables to the docmd.transfertext....

 Do While intCtr < 4
        strCSVFile = strSavePath & strTable(intCtr) & ".csv"
        DoCmd.TransferText transfertype:=acExportDelim, _
           tablename:=strTable(intCtr), _
           FileName:=strCSVFile, _
         intCtr = intCtr + 1
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros