View Single Post
 
Old 01-22-2014, 02:44 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For some code to automate Excel from Word, see:
https://www.msofficeforums.com/word-...html#post34254
The code there is only concerned with a single Excel workbook (which gets closed and the Excel session terminated, if applicable, immediately the data have been harvested), but the principles for multiple workbooks are the same (just don't run the termination code until your processing is done). An important consideration for your purposes is that you should put the code that automates Excel outside the processing loop, then just use the looping to open/modify the workbook(s).

From what I understand of your code, you seem to be modifying a single workbook over and over. For that, you could re-open the workbook for each loop, or you could simply keep the same workbook open and just modify it before saving it with the new name.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote