Setting EXCEL columns data type

M

Marilyn

I am exporting data from ACCESS database to EXCEL. The datasource is a
query.
There are numeric fields in the query but after exporting, the numeric data
type is changed to text.

How do I change the data type of the EXCEL columns before exporting.

I'm using the following statement after loading the data into an array.


oSheet.Range("A2").Resize(irows, icol).Value = vArray
vArray is defined as variant.
 
S

solex

Marilyn,

You might want to post your question in the Excel group. This is an Access
group, and you question is about excel automation, but I can suggest you
look at the excel object model in the excel programming.

Dan
 
M

Mo

So far the only way I've been able to get around this problem is by creating
a local Access table. I've set up the Access table with the correct data
types. I clear the Access table and then append the query results to the
local table. I then export the local table to Excel vs the query. Excel
seems happy with this solution. Prior to this solution, our workaround was
to have our users use the Text to Columns feature in Excel to fix it
themselves after the export.
 

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