I\'ve encountered a problem when developing on MS Visual Web Developer 2008 Express Ed. Developing ASP.NET C# on Windows7 64 bit OS.
I\'m trying to open an Excel doc
After digging the internet I found out that there is a bug in Microsoft Interop with COM objects (at least with my case which is MS Excel 2010).
The bug is that .NET checks that your thread (C# or VB code) localization is suitable to MS Excel localization you installed earlier, and if not it tells that the Microsoft.Office.Interop
library is old or invalid.
Your thread localization is derived from your computer regional settings (from the control panel --> regional and language)
Then there are two options to solve this problem:
The first solution goes like this:
using System.Threading; // For setting the Localization of the thread to fit
using System.Globalization; // the of the MS Excel localization, because of the MS bug
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US");
excelFileName = System.IO.Path.Combine(excelPath, "Ziperty Buy Model for Web 11_11_2011.xlsm");
Hope it helps :) gr8 day