Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

In my web site project I need to create an excel file in Server site. Thus I uese the following.

Try

                    Dim xlApp As Excel.Application = New Microsoft.Office.Interop.Excel.Application()
                    If xlApp Is Nothing Then
                        srvHandler.ErrorAnswer = "Excel is not properly installed!!
 CreateExcel xlApp"
                        ServerHandler._InnerError += srvHandler.ErrorAnswer
                        _Default.errorCall = True
                        Return
                    End If
                    'Dim xlWorkBooks As Excel.Workbooks = xlApp.Workbooks
                    Dim xlWorkBook As Excel.Workbook = xlApp.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet)
                    Dim xlWorkSheet As Excel.Sheets = xlWorkBook.Worksheets
                    Dim misValue As Object = System.Reflection.Missing.Value
                    xlWorkSheet.Item(1).Name = "Page1"
                    If xlWorkSheet Is Nothing Then
                        srvHandler.ErrorAnswer = "ERROR: xlWorkSheet == null!!
 CreateExcel xlWorkSheet"
                        ServerHandler._InnerError += srvHandler.ErrorAnswer
                        _Default.errorCall = True

                    End If

The all code it runs excellent in my PC but when I send it to my ISP it produces the problem

At the point of

Dim xlApp As Excel.Application = New Microsoft.Office.Interop.Excel.Application()

It throws me the following error

Create Excel Retrieving the COM class factory for component with CLSID {00024500-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered Exception

I try few ways to overcome but was worthless
Is there someone to assist me on this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
167 views
Welcome To Ask or Share your Answers For Others

1 Answer

I don't think they have Excel installed.

Or if they have during install you have to enable .NET support (at least you had to do it in Office 2003 if I remember correctly).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...