ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Bug? Unwanted date format pasted on two sheets when csv file importedin excel using ADO (https://www.excelbanter.com/excel-programming/409587-bug-unwanted-date-format-pasted-two-sheets-when-csv-file-importedin-excel-using-ado.html)

Poniente

Bug? Unwanted date format pasted on two sheets when csv file importedin excel using ADO
 
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

Barb Reinhardt

Bug? Unwanted date format pasted on two sheets when csv file impor
 
Why don't you just reformat the dates with code?

Selection.NumberFormat = "m/d/yyyy"
--
HTH,
Barb Reinhardt



"Poniente" wrote:

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



All times are GMT +1. The time now is 02:41 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com