I'm trying to export tables to Excel using the following code:-
Private Sub Command0_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Light", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Light"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Medium", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Medium"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Heavy", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Heavy"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Driveaway", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Driveaway"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Platinum", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Platinum"
End Sub
The code creates the file, but I get an error message saying the data is corrupt. The files size for the excel file is also very small considering the amount of data I'm trying to export.
Any ideas?
Private Sub Command0_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Light", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Light"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Medium", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Medium"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Heavy", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Heavy"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Driveaway", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Driveaway"
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel12, "Platinum", "W:\STOCK AVAILABILITY\Iveco Stock Availability.xls", True, "Platinum"
End Sub
The code creates the file, but I get an error message saying the data is corrupt. The files size for the excel file is also very small considering the amount of data I'm trying to export.
Any ideas?