pesan error sewaktu membuka fie excel old format or invalid type library. (Exception from HRESULT : 0x80028018 (TYPE_E_INV_DATA_READ)) pada VB

jika muncul pesan

old format or invalid type library. (Exception from HRESULT : 0x80028018 (TYPE_E_INV_DATA_READ))

sewaktu membuka file excel pada VB Net solusinya adalah tambahkan baris program ini sebelum membuka file excelnya.
System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US")


contoh :

System.Threading.Thread.CurrentThread.CurrentCulture = System.Globalization.CultureInfo.CreateSpecificCulture("en-US")
        Dim oo As Excel.Application
        Dim book As Excel.Workbook
        Dim ws As Excel.Worksheet
        oo = New Excel.Application()
        book = oo.Workbooks.Open("c:\1.xls")
        ws = book.Sheets("Sheet1")
        oo.Workbooks("performance.xls").Sheets("Sheet1").Cells(11, 75) = False


sumber :
http://social.msdn.microsoft.com/Forums/office/en-US/d1fd4279-c646-4453-9e3c-16afdacac99d/excel-2010-old-format-or-invalid-type-library-exception-from-hresult-0x80028018


No comments:

Post a Comment