DoCmd.TransferSpreadsheet

  • Thread starter Thread starter Judson Person
  • Start date Start date
J

Judson Person

I am exporting a table to MS Excel. I am using office
2002.

When I export a table into Excel in each text export, the
first character is a '. I do not understand how this
character gets into the cells. Is there some condition
that must be set in the instruction?

Mail response to
(e-mail address removed)

Thanks
 
Hi Judson,

This is normal, and necessary in order to force Excel to treat values as
text even if they can be interpreted as numbers.

Normally the apopostrophe isn't a problem, because Excel doesn't display
it in the worksheet, omits it from the Value and Formula properties of
the cell, and omits it from any reference to the contents of the cell.

If you do need to be rid of it, use code like this:

Public Sub DeApostrophise()
Dim C as Excel.Range
For Each C in Selection.Cells
C.Formula = C.Formula
Next
End Sub
 
Back
Top