PC Review


Reply
Thread Tools Rate Thread

Bizarre mutation of data upon assignment to cell !!??!!

 
 
canoe414@telecom-digest.zzn.com
Guest
Posts: n/a
 
      30th Oct 2006
Greetings all,

I've come across somthing truly bizarre - an intermittant case of a
value mutating during assignment!!!


For i = 3 To 1103
---If etch_keyarryColl.KeyExists(netval) Then
------Set etch_keyarry = etch_keyarryColl.Item(netval)
------etch_arry = etch_keyarry.arry
------If Not etch_arry(0) = "EXT" Then
---------xlWrksheet.Cells(i, 6).Value = etch_arry(0) <--- problem
------End If
------If i = 404 Then
---------ii = 4 <--- breakpoint set on this line
------End If
---End If
Next i

At the breakpoint, within the debugger positioning over etch_arry(0)
shows
6/7/9
which is correct. But positioning over xlWrksheet.Cells(i, 6).Value
shows
6/7/2009
which is INcorrect!!!

This mutation occurs not only when i = 404 but over roughly 5% of the
span of i.
The mutation is always an insertion of a snippet of text, never a
deletion.
And I've noticed a fair percentage of the time the snippet of text
added is a
3-character month. Examples:
3 becomes 3-Aug
7 becomes 7-Feb

I've dumped out etch_keyarryColl to a file and verified 6/7/9 is indeed
stored
in the correct place for when i = 404 and that there are no text
snippets resembling
month codes anywhere in the file.

I'm completely stumped! What's causing these intermittant,
not-quite-random mutations
? And more importantly how can I rid myself of them?

TIA,

Steve

 
Reply With Quote
 
 
 
 
canoe414@telecom-digest.zzn.com
Guest
Posts: n/a
 
      30th Oct 2006
A little more sluething suggests that Excel is trying to "help" me by
interpreting the data
as being a day-of-the-month or a fully-qualified date
1/3 --> 3-Jan
6/7/9 --> 6/7/2009
3/4 --> 4-Mar
6/9 --> 9-Jun
3/5 --> 5-Mar
2/10 --> 10-Feb

So the problem is not in the code but rather in what Excel is doing
with the data I stuff in the cell.

Much easier question now: how to I force a cell's formatting to be pure
plain text w/o any "assistance" from Excel?

TIA,

Steve

 
Reply With Quote
 
canoe414@telecom-digest.zzn.com
Guest
Posts: n/a
 
      30th Oct 2006
> Much easier question now: how to I force a cell's formatting to be pure
> plain text w/o any "assistance" from Excel?


The solution is to add this line:
xlWrksheet.Cells(i, 6).NumberFormat = "@"
just ahead of the assignment line

Case closed.

Thanks to myself, ;-)

Steve

 
Reply With Quote
 
miconus
Guest
Posts: n/a
 
      31st Dec 2006
I use a ' prefix on the data


<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>A little more sluething suggests that Excel is trying to "help" me by
> interpreting the data
> as being a day-of-the-month or a fully-qualified date
> 1/3 --> 3-Jan
> 6/7/9 --> 6/7/2009
> 3/4 --> 4-Mar
> 6/9 --> 9-Jun
> 3/5 --> 5-Mar
> 2/10 --> 10-Feb
>
> So the problem is not in the code but rather in what Excel is doing
> with the data I stuff in the cell.
>
> Much easier question now: how to I force a cell's formatting to be pure
> plain text w/o any "assistance" from Excel?
>
> TIA,
>
> Steve
>



 
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
Unexpected mutation of variable in LINQ (VB.NET) mike Microsoft C# .NET 3 17th Sep 2009 12:55 AM
Right arrow key has bizarre assignment Cathy Windows XP Hardware 1 11th Jan 2008 01:35 PM
VBA - Cell Assignment ajocius Microsoft Excel Programming 3 27th Jul 2005 03:57 PM
crash in xml reader with mutation =?Utf-8?B?a2lsbGtvbG9y?= Microsoft Dot NET 0 25th Nov 2004 12:05 AM
Variable assignment from cell value Vince Parsons Microsoft Excel Programming 3 22nd Mar 2004 06:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:02 AM.