Exporting to Excel issues

HVACMAN24

Registered User.
Local time
Yesterday, 20:16
Joined
Mar 20, 2010
Messages
61
I'm trying to export a report to excel to do some graphing with the data. The problem I'm having is not everything exports correctly. The report has 9 columns to it and many rows. The first column is a date, second and third columns are text (names of people and locations) and the rest are scores with one decimal point. Everything seems to export fine except the 2nd & 3rd columns. This is also ONLY when I use a button I added to the report to export it quicker and easier. If I manually go to the external data ribbon, click export to excel, pick my file and so forth everything comes through just fine. I've saved that process as a saved export process to have the button run that saved process and it still doesnt export correctly when using the button. I've tried coding the button using the following two codes but neither have worked.

DoCmd.RunSavedImportExport "ExcelExport-Scores_By_Year"
DoCmd.OutputTo acOutputReport, "Scores_By_Year", acFormatXLS, "C:\Documents and Settings\bact2t3\My Documents\Scores_By_Year.xls"


Any ideas how I can code the button to work in one step correctly?
 
Welcome to AWF.

Investigate these methods:

Docmd.TransferText
Docmd.TransferSpreadsheet
 
Thanks vbaInet, I was able to get the transferspreadsheet method to work.
 

Users who are viewing this thread

Back
Top Bottom