Click here to Skip to main content
15,907,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys

I am currently busy with a service using Microsoft.interop.Excel, and i am calculating the percentage, on my dev(windows 7) i have no problem, when i deploy the solution to the server(Server 2012) the number format is being changed from 0.00% to 0\.00% any idea what the cause of this could be?

What I have tried:

Have tried changing the number formats as follows

xSheet.Cells(27, 4 + DayCount).NumberFormat = "0.00%"
                           xSheet.Cells(27, 4 + DayCount).value = CDec(xSheet.Cells(25, 4 + DayCount).value / xSheet.Cells(26, 4 + DayCount).value)


xSheet.Cells(27, 4 + DayCount).NumberFormat = "#.00%"
                           xSheet.Cells(27, 4 + DayCount).value = CDec(xSheet.Cells(25, 4 + DayCount).value / xSheet.Cells(26, 4 + DayCount).value)
Posted
Updated 27-Mar-17 21:08pm

 
Share this answer
 
Used
.NumberFormatLocal
instead of
.NumberFormat
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900