Problem creating ActiveX object from network drive

I'm trying to open a new WORD document using a VB script in a .html file.

function boe(wordfile)
            Dim objWord                          
            Set objWord = CreateObject("Word.Application")
            objWord.Visible = true
            objWord.Documents.add(wordfile)
end function

This works fine if I launch the .html file from a local drive but as soon as I launch the file from a network drive it gives the error message "Active-X component can't create object: 'Word.Application'"

Any thoughts?

camjaiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

EDDYKTCommented:
On the same machine?

If on the other, do you load word on that machine?
0
camjaiAuthor Commented:
Yes on the same machine. Works fine if I run it from c: but gives the error message when I run it from a networkdrive.
0
_ys_Commented:
Is MS Word installed on the local machine - the machine trying to access the html page across the network?

Sounds like it's not.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

UriSCommented:
The system has some problems creating objects and running applications from network drives.
Very often the solution is to run the application/register the component and create it from:
1. a local drive.
2. (your option) from a mapped drive.
I suppose you know how to map network drives, but if you don't I'll be happy to help you with it.

anyway, it worked for me.
0
camjaiAuthor Commented:
I have Word installed on my local machine. I can create new documents and open word documents both from local drives as from a drive on my company network. In my opinion Word works fine.

I'm not sure I've made the problem clear. I have the script in a .html file on my local drive c:. If i run it with Internet Explorer it will prompt me if I want to create an ActiveX object and then it will fire up Word and open  a new document. This is what I want to happen.

When I copy the .html file to a network drive (I'm still on the same machine, same session and I have full access to all files and folders on this drive) and I run the same .html file from this location in Internet Explorer it doesnt work and gives the error message 'Can't create ActiveX component'.

It's not just creating word objects that's the problem btw. There's a create object command in many VB scripts (for file manipulation for instance) and they also work fine locally but not from a network drive.

> Set objWord = CreateObject("Word.Application")

Uris: I don't think mapping drives is the answer here but if you still think it is then I'd like to know what to do.

I've read a bit on Creating objects on the MSDN. (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbenlr98/html/vafctcreateobject.asp)
>You can create an object on a remote networked computer by passing the name of the computer to >the servername argument of CreateObject. That name is the same as the Machine Name portion of a >share name: for a share named "\\MyServer\Public," servername is "MyServer."
>Note:   Refer to COM documentation (see Microsoft Developer Network) for additional information on >making an application visible on a remote networked computer. You may have to add a registry key >or your application.

I've also tried adding the server name but i think its the 'note' that's my problem. I cant find the COM documentation but I think this is my problem.

thanks for reading all this :)
0
EDDYKTCommented:
I've create the following html and test and has no problem


<html>

<head>

</head>
<script language=vbscript>
function boe()
          Dim objWord                      
          Set objWord = CreateObject("Word.Application")
          objWord.Visible = true
         
end function
</script>
<body>
<input type="button" name="but" onclick=boe()>
</body>

</html>


you may want to post some more code
0
camjaiAuthor Commented:
Problem Solved...

it turned out to be the Internet Explorer security settings that differ for local scripts and scripts that go through the network. Can't believe I didnt think of that.

I'll split the points between you anyway for the help.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.