culture mismatch with Button name and get_Caller

E

EBenson

Running in Excel 2007 with culture zh-Ch.

I create an Excel button from my COM C# add-in using _combo =
worksheet.Shapes.AddFormControl(Excel.XlFormControl.xlButtonControl, 0, 0, 0,
0);

This defaults to an English string name "Button 1".

When this button is clicked. It runs an action that is in a .xla Within this
..xla application.Caller is a string that is the Chinese equivalent to "Button
1".

The xla calls back into the C# add-in and using the Excel applications
object I call get_Caller(System.Missing). This also returns the button name
in Chinese.

How can I ensure these are in a consistent culture?
 
E

EBenson

if I assign the Shape a name other than some form of "Button 1", "Button 1"
( notice extra space) , Excel will return the English version

Excel.Shape shape;

// create shape

shape = Worksheet.Shapes.AddFormControl ....
shape.Name = "BUTTON1"; // returns as is
= "Button 2"; // returns as is
= "dog"; // returns as is
= "Button 1" // translated

I could hypothesize on key word is "Button" for Shapes or maybe because I
used xlButtonControl, "1" is the count or id used by Excel.
 

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