By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,628 Members | 1,175 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,628 IT Pros & Developers. It's quick & easy.

Excel.Application 800080005 Error Probelm in ASP.Net

P: 3
Hi, I am New To ASP.Net and I have created a small application in ASP.Net using C# which is a reporting Tool. In this Application I have to Edit an Excel File on a Weekly basis and for that i am using Excel.Application in ASP.Net. But on the First Line itself I am getting Error Message

Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80080005.

I have searched on various sites and found that you need to assign permissions to Local ASPNET user from DCOMCNFG.exe. I did that also but still I am getting same error message. I have included Reference Microsoft Excel 11.0. Here is the code that i have written.


using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Diagnostics;
using System.Reflection;
using Microsoft.Office.Core;
using Excel;
using System.Data.SqlClient;
using System.IO;
using System.Text;
using System.Data.OleDb;

This is what i have included

Excel._Application App = new Excel.ApplicationClass();

On this statement itself I am getting the above Error Message.
// Create New Excel Application
App.ScreenUpdating = false;
// Excel will not show updations done after every single method call
App.DisplayAlerts = false;
// Excel Wil not show Any Alerts
App.Visible = true;
// Excel Application changes will be visible to the user
Excel._Workbook ExcWorkBook = App.Workbooks._Open(strFilePath, 0, false, 5, "", "", false, Excel.XlPlatform.xlWindows, "", true, false, 0, true);
// Opens New Excel WorkBook
Excel._Worksheet ExcWorkSheet = (Excel._Worksheet)App.Worksheets.get_Item("Weekly Stats");
// Get Excel Sheet Names Weekly Stats
Excel.Range ExcCell = ExcWorkSheet.get_Range("A1", Missing.Value).get_End(Excel.XlDirection.xlDown);
// Gets The First Empty Cell in First Column of Excel WorkSheet
ExcCell.Value2 = "This is the value added to the Column";
// ExcCell.Font = "Verdana";
ExcWorkBook.Save();

Sorry if I am asking very basic question but I really need this code to work.

And one more thing Although I have included reference to Microsoft Excel 11.0 Still I am not able to use Microsoft.Office.Interop.Excel is there any problem with .Net Or Office Installation? Please Guide Me.
i hope i have made myself clear about my problems and hope get some help from you all.
Thanks in Advance.
Dec 4 '07 #1
Share this Question
Share on Google+
2 Replies


radcaesar
Expert 100+
P: 759
Try this, if ur problem persist reply

1. Click Start, click Run, type regedit, and then click OK.

2. In Registry Editor, locate the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\Session Manager\SubSystems
By default, the Windows entry in the subkey has a value that is similar to the following (all on one line):
%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16

3. Right-click the Windows entry, and then click Modify. The Edit String dialog box appears.

4. In the Value data box, locate SharedSection, add 512 to SharedSection, and then click OK.

The newly changed Windows entry reads as follows:

%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16
Dec 4 '07 #2

P: 3
Try this, if ur problem persist reply

1. Click Start, click Run, type regedit, and then click OK.

2. In Registry Editor, locate the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Contro l\Session Manager\SubSystems
By default, the Windows entry in the subkey has a value that is similar to the following (all on one line):
%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16

3. Right-click the Windows entry, and then click Modify. The Edit String dialog box appears.

4. In the Value data box, locate SharedSection, add 512 to SharedSection, and then click OK.

The newly changed Windows entry reads as follows:

%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16
I have tried your Solution but still problem persists and I am getting the same error message Please suggest solution for the problem.
Thanks in Advance
Rohit
Dec 7 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.