|
-
Nov 7th, 2001, 08:50 AM
#1
Thread Starter
Addicted Member
Unable to run a macro ...
My program runs on a NT network.
On my machine and many others , it works fine. But, on some other machines, it don't.
My problem is : I want to open a word document, and then, execute some macros of this document. But, on some machines it says 'Unable to open this document'
It bugs when I try to execute the macro.
Code:
Private Sub Command1_Click()
Dim wrdApp As Word.Application
Dim wrdDoc As New Word.Document
Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.Documents.Open("\\ldpro\public\Olivier\Test.doc")
'it bugs here :
wrdApp.Run ("Project.NewMacros.Move1")
wrdApp.Selection.Text = "Test"
Do someone have an idea ??
-
Nov 7th, 2001, 09:33 AM
#2
Two thoughts:
1) do the users with problems have macro protection on?
2) do all users have the same version of word? if not, did you save the document in the EARLIEST version available?
-
Nov 7th, 2001, 09:46 AM
#3
Thread Starter
Addicted Member
The users are all using word 97
I tried on a machine where the macro protection is off.
But it don't works...
I really don't know what it is..
-
Nov 7th, 2001, 10:23 AM
#4
maybe the document is already open by another user?
have you tried opening the same document in word manually, and then running the macro?
-
Nov 7th, 2001, 12:15 PM
#5
Thread Starter
Addicted Member
thanks for your help,
I resolved my problem simply by adding an On error Resume Next statement. All works well now..
I think it's a dictionnary error or something like that in Word..
The error wasn't about my macros...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|