Forum Moderators: open
The following code:
<%@ LANGUAGE="VBSCRIPT" %>
<%
Dim MyDoc
Set MyDoc = Server.CreateObject("Word.Document")
Response.ContentType = "application/msword"
MyDoc.Application.Visible = True
Set MyDoc = Nothing
%>
I get the following error:
Server object, ASP 0177 (0x80080005)
Server execution failed
I'm using IIS5 on WinXpPro with Office2k.
Does anyone know why it happens?
(i Guess it got something to do with the components...)
Let's take this sorce code for example:
<%
Dim MyDoc
Set MyDoc = Server.CreateObject("Word.Document")
Response.ContentType = "application/msword"
MyDoc.Application.Visible = True
MyDoc.content.Font.Bold = True
MyDoc.content.Font.Italic = True
MyDoc.content.Font.Underline = True
MyDoc.content.Font.Name = "Comic Sans MS"
MyDoc.content.Font.Size = 25
MyDoc.content.insertAfter "word1 word2 word3 word4"
MyDoc.content.InsertParagraphAfter
MyDoc.Words(1).Font.Size = 10
MyDoc.Words(1).Font.ColorIndex = 1
MyDoc.Words(2).Font.Size = 20
MyDoc.Words(2).Font.ColorIndex = 2
MyDoc.Words(3).Font.Size = 30
MyDoc.Words(3).Font.ColorIndex = 3
MyDoc.Words(4).Font.Size = 40
MyDoc.Words(4).Font.ColorIndex = 4
MyDoc.PrintOut
Set MyDoc = Nothing
%>
it works on my PWS on WIN98, but not on my WinXP IIS5.
The error code on my log says something like:
The server {00020906-0000-0000-C000-000000000046} did not register with DCOM within the required timeout.
any idea?
There are also some issues with activating an out of process program from an Active Server Page. In IIS 4.0, there was a metabase variable that you had to set, but apparently that is no longer required in IIS 5.0.
I use a process in a ColdFusion app that creates an instance of MS Word. When I first did it I was getting a similar error from the ColdFusion Service. I just gave the proper permissions in IIS, the physical directory in Win2k, and checked an option under services that stated "enable interaction with desktop". Worked fine after that.
You might want to comment your code after
Dim MyDoc
Set MyDoc = Server.CreateObject("Word.Document")
to see if this line is giving you the problem, if not then comment line by line to find out which specific line is the problem.