PC Review


Reply
Thread Tools Rate Thread

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

 
 
Poniente
Guest
Posts: n/a
 
      18th Apr 2008
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 With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      18th Apr 2008
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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I format AutoCAD drawings that are pasted into Excel 2007? Huntsville Engineer Microsoft Excel Misc 0 28th May 2009 10:14 PM
Have unwanted lines under some data pasted from Excel into Word. tdhohio Microsoft Word Document Management 1 6th Apr 2009 09:24 AM
Date pasted web site causing inconsistent date format lilhoot Microsoft Excel Worksheet Functions 2 3rd Oct 2008 09:12 PM
Copied Date Changes When Pasted Into Excel doyle60@aol.com Microsoft Access VBA Modules 2 30th Nov 2007 02:25 PM
Pasted date in Excel 2003 is wrong e.g. 05-16-2006 is copied,05-15-2002 is pasted Jaap van der Veen Microsoft Excel Discussion 3 11th Aug 2006 02:08 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:19 AM.