changing the cell format on excel in vba code

G

Guest

I am exporting an access data to an excel spreadsheet using vba code. The
problem is the format for my time when exported to excel is different. How
can i change the cell format in excel using the codes in access and not in
excel itself. I use the code below to export. Thanks!

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel3,
"tblTimeTable", "" & strInputFileName & "", False
 
J

Jamie Collins

dimwit said:
I am exporting an access data to an excel spreadsheet using vba code. The
problem is the format for my time when exported to excel is different. How
can i change the cell format in excel using the codes in access and not in
excel itself. I use the code below to export. Thanks!

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel3,
"tblTimeTable", "" & strInputFileName & "", False

Try a different approach e.g.

SELECT *
INTO
[Excel 3.0;Database=C:\ExcelFileName.xls;].ExcelTableName
FROM tblTimeTable;

Jamie.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top