"old format or invalid type library"

We have an application that, among many others, has export to an Excel function. This uses the Excel COM interface and simply exports some data to a new sheet in Excel and formats it as if it appeared. For many years, we knew that if the locale of the machine is configured for something other than Office installed under it, the "old format or invalid type library" will appear. However, in Excel 2003, you could install and install the MUI package (multilingual user interface) to fix the problem. With Excel 2007 and later, there seems to be no equivalent package - there are language packs (we downloaded a 7 GB package from MSDN for Office 2007), but they either don't work (setup.exe is โ€œcorruptedโ€) or work in the sense that we are still getting the problem with the "old format or invalid type library".

Does anyone know if there is a package for Office 2007 and Office 2010 that will definitely solve this problem and where to get it from?

Alternatively, there is an MS link ( http://support.microsoft.com/default.aspx?scid=kb;en-us;Q320369 ) that shows some code (in VB.Net, I think) that presumably sets to temporarily switch to "en-US" before doing the material in Excel, and then put it off. I am skeptical about this solution because it seems that the initial installation of Office will always be "en_US". What if it was swiss german? Has anyone ever used this approach successfully, and have they ever done in win32 Delphi, and can you share a few snippets of code?

+4
source share
1 answer

The correct solution is to pass LOCALE_USER_DEFAULT whenever you call a method that expects an LCID . What do you switch to such functions?

If you do this, you will not need any of these MUI magic.

+8
source

Source: https://habr.com/ru/post/1339021/


All Articles