سلام.
و من باز هم تشکر می کنم از اینکه هیچ کس جواب سوال من رو نداد و لااقل کسی یه پست هم نزد که دلم خوش باشه.
بالاخره راه حل مشکل رو پیدا کردم :
اگر به این Error برخوردید :
Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154.
راه حل مشکل اینجاست :
http://blog.crowe.co.nz/archive/2006/03/02/589.aspx
و اگر به این Error برخوردید :
Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
راه حل مشکل اینجاست :
http://forums.microsoft.com/MSDN/Sho...84846&SiteID=1
---------------------------------------------------------------------------------------------------
This is actually a bug in Excel. It occurs when you are automating excel and you are using an english version of excel but have your locale set to another language.
You should set the current culture of the thread to "en-US" before calling the method, and set it back afterwards
System.Globalization.CultureInfo CurrentCI = System.Threading.Thread.CurrentThread.CurrentCultu re;
System.Threading.Thread.CurrentThread.CurrentCultu re = new System.Globalization.CultureInfo("en-US");
//call Excel method here
System.Threading.Thread.CurrentThread.CurrentCultu re = CurrentCI;
I had this issue when using the following Excel methods/properties:
calling Workbook.IsAddin
Enabling / Disabling a menu item (CommandBarButton.Enabled)
calling Workbook.Name (on ActiveWorkbook)
calling Workbook.FullName (on ActiveWorkbook)