Bug? Unwanted date format pasted on two sheets when csv file importedin excel using ADO

P

Poniente

Hi,
When I use CopyFromRecordset to fill a named range referring to a
different sheet than the active sheet, the date format of the CSV data
is copied to both the active sheet and the named range..
to me this appears a bug, but maybe my connection string or extended
properties are flawed.
The problem is solved 'for now' by selecting the targeted range before
opening the recordset.. but this slows down the process.

What could I do better, or is it a bug?

I'm using excel2003
strConnect = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Download\;Extended
Properties=""Text;HDR=YES;FMT=DELIMITED"""

ADOrs.Open SQLstr, strConnect, adOpenStatic, adLockOptimistic


Thanks in advance,
Poniente
 
B

Barb Reinhardt

Why don't you just reformat the dates with code?

Selection.NumberFormat = "m/d/yyyy"
 

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