Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
| Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 12th, 2004, 02:09 PM
Registered User
 
Join Date: Jul 2004
Location: , , USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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


 
Old July 12th, 2004, 03:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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
 
Old July 12th, 2004, 03:20 PM
Registered User
 
Join Date: Jul 2004
Location: , , USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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!






Similar Threads
Thread Thread Starter Forum Replies Last Post
Export Table data into an Excel SpreadSheet hewstone999 Access VBA 0 March 3rd, 2008 07:00 AM
Export Access table to a pre-formatted Excel file mccoy Access VBA 2 May 25th, 2007 08:04 AM
Export Access queries to Excel Spymaster Access VBA 2 August 18th, 2006 11:21 AM
Export an Access query to Excel Peter Martin Access 5 June 8th, 2006 06:36 AM
Export Mircosoft Excel Data to Access Table tiyyob Excel VBA 0 January 11th, 2006 06:19 AM





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