I was helped with the link below earlier which works great.
https://eileenslounge.com/viewtopic.php ... fee1b000dc
Before I run the procedure in the Excel file from the above link, I open up each file and thru a button on the QAT (in the Word doc), I run a macro from the Normal.dotm. It would seem more efficient to run the macro from the Normal.dotm as this other macro is already opening all of the Word docs from the file.
The macro name is Sub CompleteTestMeasures
Run a macro from the Normal.dotm on all files from a folder
-
- 3StarLounger
- Posts: 254
- Joined: 09 May 2020, 14:00
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Run a macro from the Normal.dotm on all files from a folder
I originally posted a macro in that thread that was intended to be run from Word. Doesn't that do what you want?
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 254
- Joined: 09 May 2020, 14:00
Re: Run a macro from the Normal.dotm on all files from a folder
Maybe I just don't see it or understand, but I still want to run the procedure from the Excel file, but as each Word file opens, can I run the macro from the Normal.dotm?
-
- Administrator
- Posts: 78236
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Run a macro from the Normal.dotm on all files from a folder
Yes, use a line like this in the loop, after the Word document has been opened:
where MacroName is the name of the macro that you want to run.
Alternatively, include the macro code in your Excel macro.
Code: Select all
objWD.Run "MacroName"
Alternatively, include the macro code in your Excel macro.
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 254
- Joined: 09 May 2020, 14:00