saving local inside the workbook???

M

monsieur.marco

Hi all,

I've got a localization problem. We generate some raw excel sheets,
then they need to be formated. Formating is now complete but we have a
localization problem. Certain columns display prices. We are using
"#,##0.00" format as our standard. When I open the formated file on my
computer everything displays properly. I am in Turkey but, I use XP pro
with regional settings set to Canada. The computers that display these
worksheets have localization
set to ("tr"). So prices dont display as "10,258.98" like on my pc,
they display as "10,258,98" with a comma instead of a dot seperating
the cents. The rest of our systems use "American" currency systems
(with the dot)

I read somewhere that i can save localization "inside" individual
worksheets or workbooks as to override so-to-speak the settings in
"Regional and Language Settings", but i've googled and cant find
anything relevant.

I'm automating this using C# and the 1.1 framework. I've posted to
relevent c# groups but it seems nobody knows anything about this. I
know this group normaly doesn't deal with this language but I figured
maybe I could ask the excel experts to at least know if this is
possible. I can also run a macro againts a file using c# so that could
also be an option.

Please, any help/educated guess would be greatly appreciated.

Thank you in advance,

Swayze
 
H

Harald Staff

Hi Swayze

The setting you mention is in the Excel menu Tools - Options -
International, but I believe it's an application setting, not a
workbook/worksheet setting. And older Excel versions doesn't have this.

HTH. Best wishes Harald
 
S

swayze

Hi Harald,

Thanks for your help. Do you know if I can change this setting
programaticaly?

regards,

Swayze
 
H

Harald Staff

In VB it's

Sub test()
With Application
.UseSystemSeparators = False
.DecimalSeparator = "."
.ThousandsSeparator = ","
End With
End Sub

I think the C# objects would be pretty similar.

HTH. Best wishes Harald
 
S

swayze

Thanks Harald,

But I still have the same problem. As soon as the file is opened on a
turkish machine, excel formats these columns in the local locale.

I've even tried to reinput all values as text, but excel formats it
back to currency.

Thank you for your time.

Swayze
 
H

Harald Staff

As I said, it doesn't follow the file. You have three things here: The
settings of the OS/Excel installed on the machine, the file and what it
contains, and your code and what it does to the Excel instance.

Best wishes Harald
 
N

NickHK

Swayze,
To me though 1,025.253 should look as I decide according to my
locale/regional settings. I would not want that value represented as
1.025,253 or some variation which may be meaningless or confusing to me.
So Excel is displaying correctly ; as the user desires. It is value that is
required for any calculation, not its appearance.
Or am I missing something ?

NickHK
 
H

Harald Staff

NickHK said:
Swayze,
To me though 1,025.253 should look as I decide according to my
locale/regional settings. I would not want that value represented as
1.025,253 or some variation which may be meaningless or confusing to me.
So Excel is displaying correctly ; as the user desires. It is value that is
required for any calculation, not its appearance.
Or am I missing something ?

Probably only "the customer is always right" <g> I agree fully with you
Nick, but sometimes we just have to.

Best wishes Harald
 
S

swayze

Thank you all for your help,

Nick - customer is always right ;)

I eventualy manualy formated the numbers and added a single quote to
the beggining of every number so that excel would treat it as text.
solved my problem.

regards

Marco
 
N

NickHK

I'm sure you're following the requirements, but if they want the number to
look a certain, why don't they change their settings to reflect that.
I'm not having a go at you... more it seems a case of the user saying
"Doctor, it hurts when I do this."

NickHK
 
S

swayze

Nick,

Our apps are web based. Most of our time is spent creating online
reports. The reports use american currency notation. This was
established before I started working for this company. Of course,
coming from Canada, this looked perfectly normal to me. All these
reports can be downloaded as excel files which are auto generated while
the report is rendered to the browser. So now, unfortunately, We cant
ask thousands of turkish users to change their local. So for
consistency, it was imperative (as far as management was concerned
anyway) that when users opened the files the same standard was beeing
used as is on the web. Fortunately, all calculations are already done
on the server so excel just needs to display the numbers.

But I definetely agree with you, when writing an app for a specific
culture, one should use the country's culture.

regards,

Swayze
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top