Solved: Distribute xla in other language versions of Excel
Greetings,
I have an xla that people in Germany and Portugal (that I know of so far) can not install. They receive an error, and the add in does not show up in the VBA editor.
On the German version of Excel 2003, the user received the following error when trying to install using "browse" from the add-ins dialog box:
"-2147024809 (80070057)" (one or more arguments are invalid)
I then asked him to save the file in the office add-ins folder so that it would appear in the add-ins dialog box automatically, and he received a "run-time error 5"
I have searched all over to try and find a solution with no luck. If anyone has any ideas on how to deal with this, I would be very appreciative! the add in can be downloaded from www.ezanalyze.com (it's free).
Translating to other languages "on the fly"
OK, so I have a solution worked out (following Killian's recommendation) that will enable multiple language versions. the parts of it are pretty simple:
declare a global variable in a module:
[vba]public dim gLang as long[/vba]
create a worksheet (called "lngTrsl8" here) in the addin which has English in column 1, Spanish in Column 2, German in column 3, etc
create a userform that displays available languages which sets gLang; I have it set up so that gLang = the column of the translated text
in a procedure, i then create a new section of code that changes elements on the form (or messages, etc) if gLang is > 1
for example
[vba]
If gLang > 1 Then
Label1.Caption = ThisWorkbook.Sheets("lngTrsl8").Cells(2, gLang).Value
Label2.Caption = ThisWorkbook.Sheets("lngTrsl8").Cells(3, gLang).Value
Label4.Caption = ThisWorkbook.Sheets("lngTrsl8").Cells(4, gLang).Value
Label5.Caption = ThisWorkbook.Sheets("lngTrsl8").Cells(5, gLang).Value
CommandButton1.Caption = ThisWorkbook.Sheets("lngTrsl8").Cells(6, gLang).Value
CommandButton_Cancel.Caption = ThisWorkbook.Sheets("lngTrsl8").Cells(8, gLang).Value
End If
[/vba]
This would require quite a bit of work initially with regard to the code in my xla file, but once set could be easily expanded to add multiple languages. All i would need to do is find someone who could do the translations in the Excel file, then I could update and re-release. A benefit of this approach is that it doesnt require the user to keep track of any additional files. A potential drawback is speed...
While language settings can be autodetected (documented in the VBE help), I think I would rather have people choose it themselves.
Anyway, if anyone has any more "elegant" solutions, I would love to hear them!
THANKS!