I'm not sure, an erroo message appreared as attachment and no code line is highlighted .Originally Posted by macropod
I'm not sure, an erroo message appreared as attachment and no code line is highlighted .Originally Posted by macropod
I am unable to replicate that error so, unless you can provide more details (eg what document is open and what kinds of formfields (if any) it has), I can't provide any more help.
Cheers
Paul Edstein
[Fmr MS MVP - Word]
Here is excel fileOriginally Posted by macropod
and word file (sorry, e just can upload 01 file one time)Originally Posted by macropod
I am still unable to reproduce the error with the files you supplied - even if I use other documents as well.
Cheers
Paul Edstein
[Fmr MS MVP - Word]
Check that you dont have any of the word forms open also enter the full path from drive letter onwards?Originally Posted by gahamchoi
Yes, no word forms open and full path was entered and it's still don't work. I don't know whyOriginally Posted by stephen_
Is any Word document open when the problem occurs? After all, the process opens every Word document that is to be processed. If none is open, then maybe the problem is because the document requires a pssword to open. Try adding:
MsgBox f1.Name
after:
n = 0
simply click OK as each file is processed. When the error message occurs, you'll then know which file the macro has trouble with and you can investigate why.
Cheers
Paul Edstein
[Fmr MS MVP - Word]
I got it, it did not work because of there are 2 excel files with macro in the same folder. I removed one and it's working now.Originally Posted by macropod
Thank you very much for your help and be patient with me, Paul
Let this be a lesson learn't -always start off ruling out simple problems first.... i,e is the power supply on etc etc etc... glad you got it to work hope you liked the macro will save a lot of time I'm sure!
Perhaps a bit of filtering should be used.
Insert:
If Left(Split(f1.Name, ".")(1), 3) = "doc" Then
before:
n = 0
and insert:
End If
before:
Next
Note: the above won't work properly with files that have periods in the filename, but you really shouldn't have such files anyway.
Cheers
Paul Edstein
[Fmr MS MVP - Word]