Click here to Skip to main content
15,797,062 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends I write a program and create new excel workbook and found error...
please solve it.

        Imports Microsoft.Office.Interop
        Imports Microsoft.Office.Interop.Excel
        Dim xlApp As Excel.Application
        Dim xlWorkBook As Excel.Workbook
        Dim xlWorkSheet As Excel.Worksheet
        Dim misValue As Object = System.Reflection.Missing.Value
        Dim i As Integer
        Dim j As Integer
        xlApp = CreateObject("Excel.Application")
        xlApp = New Excel.ApplicationClass
        xlWorkBook = xlApp.Workbooks.Add(misValue)
        xlWorkSheet = xlWorkBook.Sheets("sheet1")

Unable to cast COM object of type Microsoft.Office.Interop.Excel.ApplicationClass; to interface type &amp;amp;amp;#39;Microsoft.Office.Interop.Excel._Application. This operation failed because the QueryInterface call on the COM component for the interface with IID &amp;amp;{000208D5-0000-0000-C000-000000000046} failed due to the following error:  could not be found. (Exception from HRESULT: 0x80030002 (STG_E_FILENOTFOUND)).</pre>
Richard MacCutchan 28-Nov-15 4:27am    
Looks like MS Office is not installed.
ZurdoDev 28-Nov-15 15:36pm    
Your versions do not match.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900