Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I format AutoCAD drawings that are pasted into Excel 2007? Huntsville Engineer Excel Discussion (Misc queries) 1 May 28th 09 10:18 PM
Date pasted web site causing inconsistent date format lilhoot Excel Worksheet Functions 3 October 3rd 08 09:12 PM
File always opens with Date format set - Excel 2007 ale Excel Discussion (Misc queries) 0 December 30th 07 02:55 PM
VB: date format in an Excel file qqxz Excel Programming 2 January 25th 06 07:56 AM
how to merge a date file into an excel format massachusetts Excel Discussion (Misc queries) 1 April 26th 05 02:41 AM


All times are GMT +1. The time now is 08:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"