Question : Access to Excel via docmd.transferspreasheet creates single quote tick marks - Can I avoid them?

I am creating a VBA macro in MS access that will export a series of files from the database into a separate file based on a filter. For example it will create 10 excel files parsed by location.

DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "qry_CMP_Def_Exportv2_wCosts", filename, True

Every file after the 'acSpreadsheetTypeExcel6' creates the tick marks / single quotes before the text fields. Down saving the file then requires the user to overwrite the excel 3.0 document with the latest version.

If I use the file "export' function and check the box to save formatting I don't get this issue.

How can I save the file in the latest format via VBA Code without the tick marks/single quotes and preserving the formatting?

Code Snippet:
1:
DoCmd.TransferSpreadsheet acExport, , "qry_CMP_Export", filename, True
Open in New Window Select All

Answer : Access to Excel via docmd.transferspreasheet creates single quote tick marks - Can I avoid them?

ParkDude,

The "Tick" mark is meant to ensure that text is text and Numbers are numbers.
For example account Numbers can be Number, text, or a combination of both.
These are usually stord as text.
So when Access exports them, they end up with the tick marks.

AFAIK, the "Save Formatting" option is only available in the Export Wizard.
You biggest concern should be getting the data transferred over correctly.

Most developers simply create code in Excel to format the data.

So it looks like if you want the automation, you will have to sacrifice the formatting.
If you want the formatting, you will have to sacrifice the Automation.
:-(

Let's see what some other experts have to say.
;-)

JeffCoachman
Random Solutions  
 
programming4us programming4us