LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default CopyFromRecordSet changes cell formatting

Hi!

I know CopyFromRecordSet has caused problems to many people out there,
but I haven't found any references to this particular case:

We're using a VB6-app to automate Excel 2002. We use CopyFromRecordset
to read data from a stored proc in SQL 2000 into cells in a named area
of a worksheet.

The problem is that the format automagically for some of the cells that
we read data into. We have three columns, all formatted as Number with
3 decimals and a thousand-separator.
The source columns in SQL are decimal(15,3)
When we read the data, using CopyFromRecordset, two of the columns
remain their format (i.e. numeric). But one of the columns become a
date formatted cell, causing us lots of problems, of course.

When trouble-shooting, we noticed that this occurs even if the
resultset from the stored proc is empty (i.e. a cell in the first row
of the named area gets formatted to date).


Any ideas?

Thanks!
/Fredrik
ps. This may sound like an easy problem to solve - we can of course
programatically format the columns after the import. However, we have
lots of different Excel-worksheets that we work with, and we need to
get to the bottom with this.

 
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
CopyFromRecordset Ernst Guckel[_4_] Excel Programming 3 May 1st 05 08:03 PM
CopyFromRecordset does nothing Hafeez Excel Programming 2 August 13th 04 07:20 PM
CopyFromRecordset does nothing E Harris Excel Programming 5 January 8th 04 04:29 PM
CopyFromRecordset only pastes 1823 characters in a cell!? Julian Milano Excel Programming 5 August 11th 03 12:45 AM
Copyfromrecordset Bug ? news.btx.dtag.de Excel Programming 1 August 1st 03 07:44 PM


All times are GMT +1. The time now is 03:51 AM.

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

About Us

"It's about Microsoft Excel"