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, _
           hasfieldnames:=True
         intCtr = intCtr + 1
     
    Loop
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 4 Comments.
Join the Community
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