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.
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
> Thank you for interest.
> I understand this,but how can i avoid tis behaviour?
[quoted text clipped - 19 lines]
>> >
>> > Excel converts numbers like 2.76 to 1 febrary 1976. How to avoid this?
Artem Omelianchuk - 27 Jan 2006 05:11 GMT
Hi,
Here are my code:
CString start;
start.Format(_T("A%d"),m_rowsCount+2);
CRange oRange;
oRange = m_sheet.get_Range(COleVariant(start), m_covOptional);
oRange =
oRange.get_Resize(COleVariant((short)1),COleVariant((short)m_numberOfFields));
oRange.put_NumberFormat(COleVariant(_T("#,##0.00")) );
oRange.put_NumberFormatLocal(COleVariant(_T("#,##0.00")) );
oRange.put_Value(sa);
,where sa is COleSafeArray.
But when i try to change number format I get COleDispatchException - "Can't
change number format of class Range".
What I'm doing wrong.
> Artem,
>
[quoted text clipped - 36 lines]
> >> >
> >> > Excel converts numbers like 2.76 to 1 febrary 1976. How to avoid this?
Artem Omelianchuk - 27 Jan 2006 07:01 GMT
I make some research and find, that this behavior because of
UseSystemSeparators property. So now I turn off this property and all works
fine.
Thanks.