View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Terry Carpenter[_2_] Terry Carpenter[_2_] is offline
external usenet poster
 
Posts: 3
Default having trouble writing string to cell-xl2k

Hello!
I have some code that writes from an array to a cell. The
problem is that sometimes the string may have hyphen characters in it
which seems to cause excel to assume it's a formula. This causes out
of memory errors because the string may be very long. I've tried
setting the cell to be text before writing to it but xl still wants to
make it a formula. If I remove the hyphens it works fine but I don't
want to do that. This is the code I'm using:

'start code

rCell.Offset(i, 8).NumberFormat = "@"
rCell.Offset(i, 8).Value = udtDr(i).string(j)

'udtDr is user defined type

'end code

Thanks!