Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting Data to Excel 1

Status
Not open for further replies.

innovative1234

Programmer
Jun 12, 2002
16
0
0
US
Hi,

I am trying to perform export of a table in Access Database to a xls spreasheet.

For this I am using the command:

DoCmd.TransferSpreadsheet acExport, 8, "Report", Me!txtExportFileName, True

However I get a tick (') in the all the data exported. This happens for the fields which are of of Type TEXT.

The Data Columns in the xls looks something like:

'Date 'Place
'1/1/2004 'Chicago
'12/1/2003 'Seattle

Now if I change the Date field type to DATE I do not see the ticks anymore. It looks something like this:

'Date 'Place
1/1/2004 'Chicago
12/1/2003 'Seattle


Has someone faced a similar issue before.

Any solution?

TIA


- Amit
 
Amit,

TICS are to format as TEXT.

You do NOT want date fields as TEXT.

Check to see if the values in Excel are REALLY DATES. Format any date cell as General and the DISPLAY FORMAT will change to NUMERIC, like 1/1/2004 is REALLY 37987, FORMATTED to DISPLAY 1/1/2004

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
Is there any way so that the ticks do not appear?

The important point is if I try to export the table into excel directly from the Menu - File->Export there is no such issue. The ticks are not seen for TEXT fields.



- Amit
 
Have you tried to play with the second argument of the method ?
acSpreadsheetTypeExcel7 or acSpreadsheetTypeExcel5 or acSpreadsheetTypeExcel4 or acSpreadsheetTypeExcel3

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
THANKS PHV !!!

I tried spreadsheettype 0 which is acSpreadsheetTypeExcel3
and it worked!

Appreciate your inputs.

Thanks Again!

- Amit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top