Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
RSS
Anybody please help me. I gave almost all permissions in DCOM config and physical directory permissions to Network and Network Service.
I am trying to create a new Excel from a template using ASP .NET.
On development server it works fine, after hosting I get this error.
Dim oExcel As New Excel.Application()
Dim oBooks As Excel.Workbooks, oBook As Excel.Workbook
Dim oSheets As Excel.Sheets, oSheet As Excel.Worksheet
Dim oCells As Excel.Range
Dim sFile As String, sTemplate As String
sFile = "~/EXCEL/Status.xlsx"
sTemplate = "~/EXCEL/Source.xlsx"
oExcel.Visible = False : oExcel.DisplayAlerts = False
oBooks = oExcel.Workbooks
oBooks.Open(MapPath(sTemplate))
oBook = oBooks.Item(1)
oSheets = oBook.Worksheets
oSheet = CType(oSheets.Item(1), Excel.Worksheet)
oSheet.Name = "Data"
oCells = oSheet.Cells
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
What else should I do.
Regards,
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.
Thanks for the reply. I am already running the application under my account which has admin rights. I don't know where to put this line Marshall.ReleaseComObject(). I tried putting it at last, but it didn't recognise it and showed an error. Suggestions are
also blank.
Regards,
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.
do you run your own server or do you host it on a shared server? If you host it on a shared server, you need to contact your current host to obtain the exact error message
I am using my own server. OS of my server is windows 7.
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access
is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
This is the exact message which I am getting.
Regards,
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.
Thanks. It worked, but now I am getting a new error.
Microsoft Excel cannot access the file 'E:\Published\HrSite\EXCEL\Source.xls'. There are several possible reasons: • The file name or path does
not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently open workbook.
I checked the folder and it's permissions, everything is ok. The file is also there in the folder. I didn't keep any fies open in my server. I tried restarting it also, but didn't work.
Regards,
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.
For 64-bit (x64), create this folder:
C:\Windows\SysWOW64\config\systemprofile\Desktop
For 32-bit (x86), create this folder:
C:\Windows\System32\config\systemprofile\Desktop
The windows service, if running under the systemprofile, needs the Desktop folder. This folder was automatically created on XP and older Windows Server versions, but not for Vista and Windows 2008 Server.
Bujjigaduvzm
Member
21 Points
24 Posts
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} ...
Jan 19, 2012 06:15 AM|LINK
Anybody please help me. I gave almost all permissions in DCOM config and physical directory permissions to Network and Network Service.
I am trying to create a new Excel from a template using ASP .NET.
On development server it works fine, after hosting I get this error.
Dim oExcel As New Excel.Application()
Dim oBooks As Excel.Workbooks, oBook As Excel.Workbook
Dim oSheets As Excel.Sheets, oSheet As Excel.Worksheet
Dim oCells As Excel.Range
Dim sFile As String, sTemplate As String
sFile = "~/EXCEL/Status.xlsx"
sTemplate = "~/EXCEL/Source.xlsx"
oExcel.Visible = False : oExcel.DisplayAlerts = False
oBooks = oExcel.Workbooks
oBooks.Open(MapPath(sTemplate))
oBook = oBooks.Item(1)
oSheets = oBook.Worksheets
oSheet = CType(oSheets.Item(1), Excel.Worksheet)
oSheet.Name = "Data"
oCells = oSheet.Cells
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
What else should I do.
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.
ignatandrei
All-Star
134491 Points
21566 Posts
Moderator
MVP
Re: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000...
Jan 19, 2012 08:45 AM|LINK
1. Put site application pool runt under your account
2. use Marshall.ReleaseComObject.
Bujjigaduvzm
Member
21 Points
24 Posts
Re: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000...
Jan 19, 2012 10:30 AM|LINK
Hi,
Thanks for the reply. I am already running the application under my account which has admin rights. I don't know where to put this line Marshall.ReleaseComObject(). I tried putting it at last, but it didn't recognise it and showed an error. Suggestions are also blank.
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.
necro_mancer
Star
7981 Points
1566 Posts
Re: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000...
Jan 24, 2012 01:48 AM|LINK
hi there,
do you run your own server or do you host it on a shared server? If you host it on a shared server, you need to contact your current host to obtain the exact error message
Professional SQL 2008 R2 Service
Bujjigaduvzm
Member
21 Points
24 Posts
Re: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000...
Jan 24, 2012 02:55 AM|LINK
I am using my own server. OS of my server is windows 7.
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)).
This is the exact message which I am getting.
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.
drcool
Member
14 Points
2 Posts
Re: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000...
Jan 24, 2012 06:48 AM|LINK
error because you don't give the read / write permission to the IIS user or group users
give read/write access to IIS user for folder "C:\WINDOWS\TEMP" your problem will be resolved.
when done let me know, thanks
drcool
Chota Byte (Pk)
Bujjigaduvzm
Member
21 Points
24 Posts
Re: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000...
Jan 24, 2012 09:03 AM|LINK
Hi,
Thanks for the reply.
Tried that but didn't work.
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.
drcool
Member
14 Points
2 Posts
Re: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000...
Jan 24, 2012 09:26 AM|LINK
start run
inetmgr
enable the ASP.NET authentication for your default website
Bujjigaduvzm
Member
21 Points
24 Posts
Re: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000...
Jan 24, 2012 09:47 AM|LINK
Hi,
Thanks. It worked, but now I am getting a new error.
Microsoft Excel cannot access the file 'E:\Published\HrSite\EXCEL\Source.xls'. There are several possible reasons: • The file name or path does not exist. • The file is being used by another program. • The workbook you are trying to save has the same name as a currently open workbook.
I checked the folder and it's permissions, everything is ok. The file is also there in the folder. I didn't keep any fies open in my server. I tried restarting it also, but didn't work.
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.
Bujjigaduvzm
Member
21 Points
24 Posts
Re: Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-0000000000...
Feb 03, 2012 05:07 AM|LINK
Yaaaaaaaaaa found the solution
For 64-bit (x64), create this folder:
C:\Windows\SysWOW64\config\systemprofile\Desktop
For 32-bit (x86), create this folder:
C:\Windows\System32\config\systemprofile\Desktop
The windows service, if running under the systemprofile, needs the Desktop folder. This folder was automatically created on XP and older Windows Server versions, but not for Vista and Windows 2008 Server.
Found solution here
http://bytes.com/topic/net/answers/854715-windows-service-accessing-excel-file
V. Prasanth Kumar,
L&T Infrastructure Independent Company, Chennai.