I am currently building an Excel 2007 Add-in using VSTO (latest version + sp1) and .Net 3.5
The code simply takes the position a chart using the Top and Left properties and stores it in an XML file.
The problem im facing is that when the xml is generated using a Vista Ultimate + Excel 2007 + English environment the code works perfectly. When i move this to a Windows Server 2003 + Excel 2007 + French environment it crashes when I try to set the Top and Left properties. Further more it always returns 4 for both values on the server machine.
I have tried to play with the region and language settings but it has not changed anything so far.
I have also tried to store the values as integers instead of the float values being returned by the VSTO objects.
If someone has sone sort of idea what may be going wrong please point me in the right direction.
I will edit once ive traced some more...
-
You need to post more info about exactly what you are doing and what error you are seeing. Probably you need to be formatting / parsing the numeric values using CultureInfo.InvariantCulture rather than the default CultureInfo.CurrentCulture.
From Joe -
I'm not sure if this will help or not, but you may want to check out the System.Xml.XmlConvert class. This class will allow you to serialize data types to a string value that is locale independent. When you extract the xml on another machine you can convert the value back into the appropriate data type using this same class and it will assume the Culture of the current environment.
Alexandre Brisebois : I will try this since i'm currently just doing xml.Value = the value from the com objects i'll keep you posted thxFrom BenR
0 comments:
Post a Comment