View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Automation:insert number to Excel problem

Artem,

Check your "Regional and language options" from the control panel in windows, specifically, the
regional options for short date.

How to avoid this in the code depends on how you are assigning your cell values. Perhaps along the
lines of:

With Range("A1")
.NumberFormat = "0.00"
.Value = CDbl(SafeArray(i))
End With

HTH,
Bernie
MS Excel MVP


"Artem Omelianchuk" wrote in message
...
Thank you for interest.
I understand this,but how can i avoid tis behaviour?

I can't post my code today,i make this tomorrow. But in general I Get Range
from the Worksheet and add SafeArray there.
Number represented by string.

"Bernie Deitrick" wrote:

Artem,

If your locallized date setting allows the use of . as the date delimiter, then Excel could
interpret "2.76" (a string) as a date.

Beyond that, post your code.

HTH,
Bernie
MS Excel MVP


"Artem Omelianchuk" wrote in message
...
Hi.
I use Range to insert some numbers to the sheet. All works find. But I have
one problem.

Excel converts numbers like 2.76 to 1 febrary 1976. How to avoid this?