Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateObject("Word.Application") - doesn't work?

Status
Not open for further replies.

albie101

Programmer
Oct 8, 2001
50
NZ
Hi all,

I am having a problem where I am trying to open a word application from an asp page. I have the following code:

dim wordDoc
set wordDoc = CreateObject("Word.Application")
wordDoc.Visible = true
wordDoc.Documents.Open("test.doc")

but it dies on the createobject call with the error:
Microsoft VBScript runtime (0x800A01AD)
ActiveX component can't create object: 'Word.Application'

Does anyone know why this occurs and how I can fix it?

Thanks
Em
 
If this is an asp page and you are running it server side you will want to include the keyword server.

set wordDoc = Server.CreateObject("Word.Application")

Hope this solves your problems.....:)
 
thanks - I tried that though and got "invalid progid" error. Any other ideas?

Em
 
You also have to make sure that the "Word" object library is installed on the server and it is the correct version to which test.doc was created in.

i.e. if "test.doc" was created in Word 2000 Then you will have to have Word 2000 object Library(9.0) installed on the server not 8.0

Don't know whether this helps, but I've had a similar problem in the past.

Regards,

Codefish
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top