
Error trying to open MS Word
Not sure how to get around this error--
I'm getting an error when trying to open a word document. The error I get
is: 'Active X component can't create object'
Here is the code:
Dim objWord
Sub Btn1_onclick()
call OpenDoc("http://myserver/myfile.doc")
End Sub
Sub OpenDoc(strLocation)
Set objWord = CreateObject("Word.Application")
objWord.Visible = true
objWord.Documents.Open strLocation
End Sub
The code is taken directly from a Microsoft KB article.
Thanks for your help!
Dave