p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access VBA (http://p2p.wrox.com/forumdisplay.php?f=80)
-   -   Export Table from Access to Excel (http://p2p.wrox.com/showthread.php?t=15335)

aramchan July 12th, 2004 02:09 PM

Export Table from Access to Excel
 
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 only.

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



bmains July 12th, 2004 03:06 PM

Hey,

The tick is an Excel thing. I think it does that to differentiate text versus functions, if I remember correctly. I may be wrong, but I know that Excel put's a ' in front for a specific reason.

If you plan to do anything with the data (import to another data source) I don't think you'll have a problem.

Brian

aramchan July 12th, 2004 03:20 PM

Well I found the solution:

If I use SpreadsheetType = 0 which is acSpreadsheetTypeExcel3 instead of 8 it works!!

No ticks are seen in Text Fields.

Thanks Anyways for your comments!




All times are GMT -4. The time now is 07:23 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.