Error when creating Excel worksheets with VB.NET: 80070005 Access is denied

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt Hi,<span style="font-family:Times New Roman; font-size:small
<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt Im trying to generate Office 2010 files (xlsx) in a vb.net project (Visual Studio 2010 fw 4.0).<br/>
<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt On my developing PC it works. Once on the server it generates an error:
<p style="margin:6pt 0cm 6pt 35.4pt; line-height:normal <em style=" <span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt 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)).
[/i]
<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt On the server I tried with
<strong style=" dcomcnfg and navigate to <strong style=" DCOM Config and locate Excel. To solve the problem I would have chosen
<strong style=" Customize in the <strong style=" Security tab under
<strong style=" Launch and Activation Permissions and add the account under which the site is running (our server task user) and assign
<strong style=" Local Launch & Local Activation permissions .
<p style="margin:6pt 0cm; line-height:normal <span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt But I cant find Excel there, even when I look for
<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:10pt CLSID {00024500-0000-0000-C000-000000000046}<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt , although Office
2010 (including Excel) is installed on the server.
<p style="margin:6pt 0cm; line-height:normal <span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt The error occurs on the moment this code is executed:
<p style="margin:0cm 0cm 0pt; line-height:normal <span style="font-family:Consolas; font-size:9.5pt m_Excel =
<span style="color:blue NewMicrosoft.Office.Interop.Excel.<span style="color:#2b91af Application
<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt Where
<span style="font-family:Consolas; font-size:9.5pt m_Excel<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt is defined as:
<span lang="EN-US" style="color:blue; font-family:Consolas; font-size:9.5pt Private<span lang="EN-US" style="font-family:Consolas; font-size:9.5pt m_Excel
<span style="color:blue As Microsoft.Office.Interop.Excel.<span style="color:#2b91af Application
<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt Anybody an idea where it goes wrong or why it goes wrong on the server.
<span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt Thanks

<p style="margin:6pt 0cm; line-height:normal <span lang="EN-US" style="color:black; font-family:"Verdana","sans-serif"; font-size:9pt RuWel




View the full article
 
Back
Top