If you’re doing some Excel automation like creating a sheet with some graphs from .NET, you may run into the “Old format or invalid type library” error which is quite nicely described in this Microsoft Support article. At this moment there’s no fix available, but the article describes not one, not two, but three workarounds. I chose the third one where you switch the Culture for your thread to “en-US”.
When giving this a try, it solved the error mentioned above but then I started getting “Exception from HRESULT: 0x800A03EC” errors. After searching for a while I finally found the reason: you should not switch the Culture back to the original one after you’ve added your new Excel workbook as shown in the workaround. First finish whatever you want to automate in Excel and switch the Culture back at the end.
In C# this looks like the following: