Localization problems

J

Jan Kucera

Hi,
I have a problem that I am developing on english versions of Office
(2007) and my macros run on localized versions.

So for example, I can use Cells.Style.Name = "Checked Cell", but this throws
an exception on the czech version, for example.

I've discovered there are Name and NameLocal properties, as well as
NumberFormat and NumberFormatLocal - why they aren't used? I see all of them
to be localized.

So... to ask my question, how could I set style or number format to the
built-in one and make that work on all localizations?


Thanks, Jan
 
W

Wei Lu [MSFT]

Hello Jan,

I suggest you to use the VSTO instead of VBA.

Since all the VSTO add-in will complied to be the IR binary and it will no
such localization problem.

Here are some article for your reference.

Globalization and Localization of Office Solutions
http://msdn2.microsoft.com/en-us/library/4f9sc85k(VS.80).aspx

Office Developer Center
http://msdn2.microsoft.com/en-us/office/aa905533.aspx

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jan Kucera

Hello,
thank you for your answer. I don't have a localized version on my
development computer, so this might be a blind question, but

1) "Visual Studio Tools for Office uses the LCID 1033 (en-US) when passing
all data. "
Does this mean that even when running localized Windows, UI, localized .NET
Framework and localized Excel, I should pass en-US number formats and
function names to the Excel classes? In other words, that I should use
InvariantCulture instead of CurrentCulture/CurrentUICulture when formatting
numbers?

2) Does this apply for styles names as well? I mean can I use
Selection.Style.Name = "Checked Cell" in the code and expect it to work on
all localizations?

Thanks
Jan
 
W

Wei Lu [MSFT]

Hello jan,

You only need to specify the format as en-us in your VSTO code.

The UI will automatically change it.

As for the Style Name, yes, you could use it.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Wei Lu [MSFT]

Hi ,

How is everything going? Please feel free to let me know if you need any
assistance.

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

Jan Kucera

Hi Wei Lu,
as I said my development computer has non-localized version of Office so
I'll just assume it works and after I deploy to some users, I will let you
know.

Thank you very much for your help,
Jan
 
W

Wei Lu [MSFT]

Hello Jan,

Please feel free to come back when you have any question. Thank you!

Sincerely,

Wei Lu
Microsoft Online Community Support

==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

Chay Harley

You can always check the locale first before you issue the command? I use
this in my code as I write code for both English and Japanese spreadsheets.

Private Sub CommandButton1_Click()
'all ID numbers are at
http://www.microsoft.com/globaldev/reference/lcid-all.mspx
Select Case Application.LanguageSettings.LanguageID(msoLanguageIDUI)
Case 1033
MsgBox "1033: This is US English"
Case 409
MsgBox "1041: This is Japanese"
Case Else
MsgBox "Unsure. The actual value is: " &
Application.LanguageSettings.LanguageID(msoLanguageIDUI)
End Select

End Sub

HTH,

Chay Harley.
 

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