|
-
Aug 31st, 2009, 12:10 AM
#1
Thread Starter
New Member
80040154: Retrieving the COM class factory for component with CLSID eorr in .NET
Hi,
I am getting the below error while i am using Microsfot excel interop. In my server there no excel installation. With out excel installation i want to export data to excel. So i used excel interop. But i am getting the below error.
Error: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154.
I am using the below code. It is working, if the machine have excel installation, But i dont have excel installation in my server.
Please help me to resolve this issue.
Advance Thanks.
Dim lobjExcelApp As Excel.Application
Dim lobjExcelWrkBk As Excel.Workbook
Dim lobjExcelWrkshtFee As Excel.Worksheet
Dim lobjsht As Excel.Worksheet
Dim rowCnt As Integer
Dim colCnt As Integer
Try
lobjExcelApp = New Excel.Application
lobjExcelApp.Visible = False
lobjExcelWrkBk = lobjExcelApp.Workbooks.Open(strSourceFilePath, , ReadOnly:=True)
lobjsht = lobjExcelWrkBk.Sheets("Sheet1")
lobjExcelWrkBk = lobjExcelApp.ActiveWorkbook
lobjsht.Range("A2").CopyFromRecordset(ors)
lobjExcelWrkBk.SaveAs(strDestinationFileName)
lobjExcelApp.Quit()
Catch
End Try
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|