We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Error in excel

The problem continues... (A simple example)

Dim Saldo as string = "-881147.42"
*saldo must be a string not a number
Hoja.Range(F, C).Value = Saldo2


...and in excel : -88,114,742.00 why?





**************************
We are using vstudio2003 and Essential Studio Backoffice v 4.400.0.51
We have a problem usin excel.
for example:
hoja.Range(F, C).Formula = FormulaFinal

and i save the book as :

ibro.SaveAs(c:\work\libro2.XLS")

where formulafinal = "881147,42+B1+881147,42"
where B1 = 10

when i open the book "c:\work\libro2.XLS" In the place of comma places point and comma

like = "881147;42+B1+881147;42" is an error
¿how can i to solve this problem?

(im sorry for my english)

Libro1_vba.zip


By Melba [Syncfusion] at 7/3/2007 6:40:58 AM


Hi Haf,

Thank you for your interest in Essential XlsIO.

You can solve this problem by using separator "." instead of ",". Please refer the following code snippet to achieve this:

[C#]

string formulafinal = "881147.42+B1+881147.42";

//Formula
sheet.Range["C5"].Formula = formulafinal;

Here is the sample for your reference:

http://websamples.syncfusion.com/samples/XlsIO.Windows/F63310/main.htm

Please let me know if you need any further assistance.

Thanks,
Melba



excel0.zip

11 Replies

MW Melba Winshia Syncfusion Team July 4, 2007 04:46 AM UTC

Hi Haf,

You should use IRange.Text property instead of Value property to display number as string. Please refer the following code snippet to achieve this:

[VB.Net]

Dim Saldo As String = "-881147.42"
'saldo must be a string not a number
sheet.Range("C5").Text = Saldo

Here is the sample for your reference:

http://websamples.syncfusion.com/samples/XlsIO.Windows/63384/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba



HI Hixem July 4, 2007 07:34 AM UTC

Hi Melba. ¿do you have an example?
Thank you very much

>Hi Haf,

You should use IRange.Text property instead of Value property to display number as string. Please refer the following code snippet to achieve this:

[VB.Net]

Dim Saldo As String = "-881147.42"
'saldo must be a string not a number
sheet.Range("C5").Text = Saldo

Here is the sample for your reference:

http://websamples.syncfusion.com/samples/XlsIO.Windows/63384/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba



MW Melba Winshia Syncfusion Team July 4, 2007 08:42 AM UTC

Hi Haf,

You can download sample(Format_VB.zip) from the following link:

http://websamples.syncfusion.com/samples/XlsIO.Windows/63384/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba



HI Hixem July 5, 2007 08:09 AM UTC

Thanks,

..but i need the value like a fomula
example:

for example
Dim A as string = "-881147.42"
Dim B as string ="+C1"
Dim Formul_a as string = "="+a+b
sheet.Range("C5").Text = Formul_a

I need this in excel (like a formula) : "=-881147.42+C1" (That excel evalue the formula)








Dim Saldo As String = "-881147.42"
'saldo must be a string not a number
sheet.Range("C5").Text = Saldo





>Hi Haf,

You can download sample(Format_VB.zip) from the following link:

http://websamples.syncfusion.com/samples/XlsIO.Windows/63384/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba



HI Hixem July 5, 2007 08:10 AM UTC

Thanks,

..but i need the value like a fomula
example:

for example
Dim A as string = "-881147.42"
Dim B as string ="+C1"
Dim Formul_a as string = "="+a+b
sheet.Range("C5").Text = Formul_a

I need this in excel (like a formula) : "=-881147.42+C1" (That excel evalue the formula)








Dim Saldo As String = "-881147.42"
'saldo must be a string not a number
sheet.Range("C5").Text = Saldo





>Hi Haf,

You can download sample(Format_VB.zip) from the following link:

http://websamples.syncfusion.com/samples/XlsIO.Windows/63384/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba



HI Hixem July 5, 2007 08:10 AM UTC

Thanks,

..but i need the value like a fomula
example:

for example
Dim A as string = "-881147.42"
Dim B as string ="+C1"
Dim Formul_a as string = "="+a+b
sheet.Range("C5").Text = Formul_a

I need this in excel (like a formula) : "=-881147.42+C1" (That excel evalue the formula)








Dim Saldo As String = "-881147.42"
'saldo must be a string not a number
sheet.Range("C5").Text = Saldo





>Hi Haf,

You can download sample(Format_VB.zip) from the following link:

http://websamples.syncfusion.com/samples/XlsIO.Windows/63384/main.htm

Kindly let me know if you have any other questions.

Thanks,
Melba



MW Melba Winshia Syncfusion Team July 5, 2007 12:33 PM UTC

Hi Haf,

If your intention is to display the value like a formula, it can be achieved by using the Formula property. The Text property is used only to get and set text and not formula.

Dim A As String = "-881147.42"
Dim B As String = "+C1"
Dim Formul_a As String = "=" + A + B
sheet.Range("C5").Formula = Formul_a

Please refer the sample in the below link which illustrates the above.

http://websamples.syncfusion.com/samples/XlsIO.Windows/F63384_1/main.htm

If I have misunderstood your requirement, could you please explain me in detail, so that I can work in depth and try to send a better solution?

Thanks,
Melba





HI Hixem July 5, 2007 01:53 PM UTC

Hy Melba
I´m worrkin In ASPNET ,It eliminates the decimal point
I am tired, I have tried everything

Look at the document below





>Hi Haf,

If your intention is to display the value like a formula, it can be achieved by using the Formula property. The Text property is used only to get and set text and not formula.

Dim A As String = "-881147.42"
Dim B As String = "+C1"
Dim Formul_a As String = "=" + A + B
sheet.Range("C5").Formula = Formul_a

Please refer the sample in the below link which illustrates the above.

http://websamples.syncfusion.com/samples/XlsIO.Windows/F63384_1/main.htm

If I have misunderstood your requirement, could you please explain me in detail, so that I can work in depth and try to send a better solution?

Thanks,
Melba





error88.zip


MW Melba Winshia Syncfusion Team July 6, 2007 10:41 AM UTC

Hi Haf,

I am afraid that I was not able to reproduce the issue in English-United States regional settings. The issue is seems to be with the regional settings. Could you please provide us the following details?

1) Regional settings (Control Panel->Regional and Language Options - > Regional Options)

2) Office version.

3) Platform you are working with

The above details which would help us to sort out the cause of the issue and provide you a solution?

Thanks,
Melba


HI Hixem July 11, 2007 09:41 AM UTC

I Am using Vstudio 2003
I´m working in ASPNET (VB)
Microsoft Office 2003
Regional Setting Spain

Decimal Point = .

Hi Haf,

I am afraid that I was not able to reproduce the issue in English-United States regional settings. The issue is seems to be with the regional settings. Could you please provide us the following details?

1) Regional settings (Control Panel->Regional and Language Options - > Regional Options)

2) Office version.

3) Platform you are working with

The above details which would help us to sort out the cause of the issue and provide you a solution?

Thanks,
Melba


MW Melba Winshia Syncfusion Team July 11, 2007 12:34 PM UTC

Hi Haf,

We have identified this issue "It eliminates the decimal point" to be a defect and we thank you for bringing this to our attention. To facilitate tracking the progress of the fix, and timely resolution, we request you to create an incident in our incident database Direct Trac. Our development team would be able to determine the fix and alert you with the service pack download details as soon as they are made available.

Thanks,
Melba

Loader.
Live Chat Icon For mobile
Up arrow icon