How to format cells of a column as text programmetically


D

DPM

Hi,

I have got an excel with data and need to import the data into a DBF.
Therefore I use the ODBC drivers and the DBF gets created.

But found the following problem,

When data was entered into the excel initallly, the column was not formated
text and remains in general format.
Thereafter values were entered such as,
123
45.l00
1/2

Before importing using ODBC I format the entire column as Text
programmetically.
But eventhough the resulting DBF gets 0, as induvidual cells in the excel
does not get formatted, even the column is formatted.
Noticed that manually if you goto each cell in the excel and just enter, the
value gets formatted into Text and thereafter gets imported properly using
ODBC.

Could someone please advice how to format each cell in the column, to Text
programmetically, which converts the data to text.
So that data is proper when the DBF is created using ODBC.

Note:
SaveAs() of Excel2003 works fine. Excel2007 does not have SaveAs() therefore
ODBC is used above.
 
Ad

Advertisements

Ad

Advertisements

D

DPM

Hi,

Even formatting the column or each cell with .NumberFormat = "@" formats the
cell but does not convert the value.
Already entered numbers remains as it is, does not get converted to number
beginning with a ' or with the mark towards the left top of the cell.

Anyother suggestions please
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top