How to get COM Variants International
-
We've got an application i'm working on that utilizes COM Variants and Excel (values are read in from a text file and output into Excel). Everything is hunky dory when the user is under US International Settings. However, when our European friends try out the product, there are some strange results - one of which i'm curious about here. The process works like this: we read in some data, send it to Excel, read it back out (probably not the most efficient, but it handles some interpretation of the data we need rather effectively and my boss keeps me on a tight budget, so i just stick to what is quickest to do), format the data according to user specifications, and save it back into the Excel file. The problem is what Excel says about international data when it is read back out - in particular, international numbers. To demonstrate, here is what happens in the US: Value: 1,000.00 -> Read in as a number in the VARIANT object -> Output to Excel correctly. In Germany: Value: 1.000,00 (notice the number formatting change) -> Read in as a BSTR(!) in the VARIANT object -> Output to Excel as text instead of a number. i've monkied around setting my Regional settings to Germany, etc., but no luck. Any advice on this one? COM seems to want to stay whitebread American, and i'm having trouble broadening its horizons. Thanks! -- modified at 10:34 Tuesday 4th October, 2005