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.
2 5588
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
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
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Otie |
last post by:
I found the following under the GetObject help notes and in the
example for GetObject:
"This example uses the GetObject function to get a reference to a
specific Microsoft Excel worksheet...
|
by: Ange T |
last post by:
Hi there,
I'm having pain with the VB behind an Access form. The form is used to
create reports in Excel based on the details entered in the form. This
has always worked without error on my...
|
by: mytfein |
last post by:
Hi Everyone,
Background:
Another department intends to ftp a .txt file from the mainframe, for me
to process.
The objective is to write a vb script that would be scheduled to run
daily to...
|
by: Rick Brown |
last post by:
After reading 30+ threads on the subject and implementing pertinent
changes I still have an instance of Excel that won't close.
I hope its due to my poor coding and someone can spot the error....
|
by: pmud |
last post by:
Hi,
I need to use an Excel Sheet in ASP.NET application so that the users can
enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever
the USER ENETRS needs to go to the...
|
by: Rich Wallace |
last post by:
Hi all,
I have a VB app that runs and manages individual XLS files within a single
COM object. Upon processing the final fie, I attempt to close out the EXCEL
object and release it using...
|
by: Gorgo |
last post by:
Hello
I'm sorry if this is not the right group to post this post, but
unfortunetly this one is one of the best i know.
I'm doing and asp.net application with need to create excel file thru...
|
by: likhin M |
last post by:
Hi all,
I am developing a vb application to retrive data from excel file using excel object.
But the probelm is, the extracted data is not in the correct format.
I am retriving time values...
|
by: erikbower65 |
last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps:
1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal.
2. Connect to...
|
by: linyimin |
last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
|
by: erikbower65 |
last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA:
1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
|
by: kcodez |
last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
|
by: Taofi |
last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same
This are my field names
ID, Budgeted, Actual, Status and Differences
...
|
by: DJRhino1175 |
last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this -
If...
|
by: Rina0 |
last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
|
by: lllomh |
last post by:
How does React native implement an English player?
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
| |