• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 451
  • Last Modified:

Error while creating Excel application in ASP

I get the following error at this perticular line

set e=server.CreateObject("Excel.Application")

error message

Error Type:
Server object, ASP 0177 (0x80080005)
Server execution failed

Is there any file or dll or library to be registered to create an excel application?
Or is there any requirement which is missing on the server?



0
froggy77
Asked:
froggy77
  • 2
  • 2
  • 2
  • +2
1 Solution
 
rwdunningCommented:
try this bit of code



<%@ Language=VBScript %>
<%
   'Change HTML header to specify Excel's MIME content type
   Response.Buffer = TRUE
   Response.ContentType = "application/vnd.ms-excel"
%>
0
 
farzinmCommented:
It could be a permission issue
You can try this
1) Run DCOMCNFG.EXE

2) In the Application tab select Microsoft Excel Application and then click
the Properties button to configure the application.

3) In the Properties dialog you can configure your permissions for the
Microsoft Excel Application via the Security tab.
0
 
froggy77Author Commented:
I cannot use

<%@ Language=VBScript %>
<%
  'Change HTML header to specify Excel's MIME content type
  Response.Buffer = TRUE
  Response.ContentType = "application/vnd.ms-excel"
%>

because at the end of the asp page I have to save the excel file and I cannot do it using the above code.

And regarding DCOMCNFG.EXE
I changed the permission but it still gives the error message. Should I reboot the system after changing the security options?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
farzinmCommented:
yes u can try that. If it is a permission issue it should be solved this way
0
 
rwdunningCommented:
If you're using Excel 2002 you can use this object instead.
Hope it helps. I can provide more info on how to populate the fields if needed.

<object classid="clsid:0002E551-0000-0000-C000-000000000046" id="Spreadsheet1">
  <param name="DataType" value="XMLDATA">
  <param name="AllowPropertyToolbox" value="-1">
  <param name="AutoFit" value="0">
  <param name="Calculation" value="-4105">
  <param name="Caption" value="Microsoft Office Spreadsheet">
  <param name="DisplayColumnHeadings" value="-1">
  <param name="DisplayGridlines" value="-1">
  <param name="DisplayHorizontalScrollBar" value="-1">
  <param name="DisplayOfficeLogo" value="-1">
  <param name="DisplayPropertyToolbox" value="0">
  <param name="DisplayRowHeadings" value="-1">
  <param name="DisplayTitleBar" value="0">
  <param name="DisplayToolbar" value="-1">
  <param name="DisplayVerticalScrollBar" value="-1">
  <param name="DisplayWorkbookTabs" value="-1">
  <param name="EnableEvents" value="-1">
  <param name="MaxHeight" value="80%">
  <param name="MaxWidth" value="80%">
  <param name="MoveAfterReturn" value="-1">
  <param name="MoveAfterReturnDirection" value="-4121">
  <param name="RightToLeft" value="0">
  <param name="ScreenUpdating" value="-1">
  <param name="EnableUndo" value="-1">
    <param name="XMLData" value="&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;ss:Workbook xmlns:x=&quot;urn:schemas-microsoft-com:office:excel&quot;
 xmlns:ss=&quot;urn:schemas-microsoft-com:office:spreadsheet&quot;
 xmlns:c=&quot;urn:schemas-microsoft-com:office:component:spreadsheet&quot;&gt;
 &lt;x:ExcelWorkbook&gt;
  &lt;x:ProtectStructure&gt;False&lt;/x:ProtectStructure&gt;
  &lt;x:ActiveSheet&gt;0&lt;/x:ActiveSheet&gt;
 &lt;/x:ExcelWorkbook&gt;
 &lt;ss:Styles&gt;
  &lt;ss:Style ss:ID=&quot;Default&quot;&gt;
   &lt;ss:Alignment ss:Horizontal=&quot;Automatic&quot; ss:Rotate=&quot;0.0&quot; ss:Vertical=&quot;Bottom&quot;
    ss:ReadingOrder=&quot;Context&quot;/&gt;
   &lt;ss:Borders&gt;
   &lt;/ss:Borders&gt;
   &lt;ss:Font ss:FontName=&quot;Arial&quot; ss:Size=&quot;10&quot; ss:Color=&quot;Automatic&quot; ss:Bold=&quot;0&quot;
    ss:Italic=&quot;0&quot; ss:Underline=&quot;None&quot;/&gt;
   &lt;ss:Interior ss:Color=&quot;Automatic&quot; ss:Pattern=&quot;None&quot;/&gt;
   &lt;ss:NumberFormat ss:Format=&quot;General&quot;/&gt;
   &lt;ss:Protection ss:Protected=&quot;1&quot;/&gt;
  &lt;/ss:Style&gt;
 &lt;/ss:Styles&gt;
 &lt;c:ComponentOptions&gt;
  &lt;c:Label&gt;
   &lt;c:Caption&gt;Microsoft Office Spreadsheet&lt;/c:Caption&gt;
  &lt;/c:Label&gt;
  &lt;c:MaxHeight&gt;80%&lt;/c:MaxHeight&gt;
  &lt;c:MaxWidth&gt;80%&lt;/c:MaxWidth&gt;
  &lt;c:NextSheetNumber&gt;4&lt;/c:NextSheetNumber&gt;
 &lt;/c:ComponentOptions&gt;
 &lt;x:WorkbookOptions&gt;
  &lt;c:OWCVersion&gt;10.0.0.2621         &lt;/c:OWCVersion&gt;
  &lt;x:Height&gt;7620&lt;/x:Height&gt;
  &lt;x:Width&gt;15240&lt;/x:Width&gt;
 &lt;/x:WorkbookOptions&gt;
 &lt;ss:Worksheet ss:Name=&quot;Sheet1&quot;&gt;
  &lt;x:WorksheetOptions&gt;
   &lt;x:Selected/&gt;
   &lt;x:ViewableRange&gt;R1:R262144&lt;/x:ViewableRange&gt;
   &lt;x:Selection&gt;R1C1&lt;/x:Selection&gt;
   &lt;x:TopRowVisible&gt;0&lt;/x:TopRowVisible&gt;
   &lt;x:LeftColumnVisible&gt;0&lt;/x:LeftColumnVisible&gt;
   &lt;x:ProtectContents&gt;False&lt;/x:ProtectContents&gt;
  &lt;/x:WorksheetOptions&gt;
  &lt;c:WorksheetOptions&gt;
  &lt;/c:WorksheetOptions&gt;
 &lt;/ss:Worksheet&gt;
 &lt;ss:Worksheet ss:Name=&quot;Sheet2&quot;&gt;
  &lt;x:WorksheetOptions&gt;
   &lt;x:ViewableRange&gt;R1:R262144&lt;/x:ViewableRange&gt;
   &lt;x:Selection&gt;R1C1&lt;/x:Selection&gt;
   &lt;x:TopRowVisible&gt;0&lt;/x:TopRowVisible&gt;
   &lt;x:LeftColumnVisible&gt;0&lt;/x:LeftColumnVisible&gt;
   &lt;x:ProtectContents&gt;False&lt;/x:ProtectContents&gt;
  &lt;/x:WorksheetOptions&gt;
  &lt;c:WorksheetOptions&gt;
  &lt;/c:WorksheetOptions&gt;
 &lt;/ss:Worksheet&gt;
 &lt;ss:Worksheet ss:Name=&quot;Sheet3&quot;&gt;
  &lt;x:WorksheetOptions&gt;
   &lt;x:ViewableRange&gt;R1:R262144&lt;/x:ViewableRange&gt;
   &lt;x:Selection&gt;R1C1&lt;/x:Selection&gt;
   &lt;x:TopRowVisible&gt;0&lt;/x:TopRowVisible&gt;
   &lt;x:LeftColumnVisible&gt;0&lt;/x:LeftColumnVisible&gt;
   &lt;x:ProtectContents&gt;False&lt;/x:ProtectContents&gt;
  &lt;/x:WorksheetOptions&gt;
  &lt;c:WorksheetOptions&gt;
  &lt;/c:WorksheetOptions&gt;
 &lt;/ss:Worksheet&gt;
&lt;/ss:Workbook&gt;
">

 
0
 
HenpatelCommented:
Do you have to display the page in Regular web format and then save the same page as excel
or you want to create an excel file along with some other things on the page and open it on click of button!!
Explain how do u want it!!
0
 
froggy77Author Commented:
I create the excel file in the asp page, populate data from the database and I save it using the following command

wb.saved=true
wb.savecopyas newfile

and in the last line fo the asp page I redeirect to that file

Response.Redirect newfile

So finally what happens is when I click a button it creates the excel file , saves a copy and opens the excel file in xls format.
0
 
COBOLdinosaurCommented:
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
 
COBOLdinosaurCommented:
It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
PAQ

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&

0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now