I have a Word template (report.dot) which includes links to data stored in several sheets within an Excel file (stored in the same directory).
One of the Excel sheets can contain up to 24 identically formatted blocks of data. Each block appears on a separate A4 page in the Word file, and currently 24 pages are reserved in the report, even though many of them will be blank. Blocks are filled in sequence (1st, 2nd, 3rd, etc) so all the empty blocks (and all the blank pages) will be at the end.
I can calculate (within Excel) how many pages will actually be needed. Is it possible to test this cell and then include exactly the right number of data blocks in the Word report? If yes, can someone show me how?
This is how the Excel data blocks are currently inserted into the report...
Apologies if I have posted in the wrong forum. I read the sticky and this seemed like the right place, but please move it if I'm wrong.
One of the Excel sheets can contain up to 24 identically formatted blocks of data. Each block appears on a separate A4 page in the Word file, and currently 24 pages are reserved in the report, even though many of them will be blank. Blocks are filled in sequence (1st, 2nd, 3rd, etc) so all the empty blocks (and all the blank pages) will be at the end.
I can calculate (within Excel) how many pages will actually be needed. Is it possible to test this cell and then include exactly the right number of data blocks in the Word report? If yes, can someone show me how?
This is how the Excel data blocks are currently inserted into the report...
Code:
{ LINK Excel.Sheet.8 "{ filename \p }\\..\\Forms.xls" Sheet1!Page01 \p \* MERGEFORMAT }
{ LINK Excel.Sheet.8 "{ filename \p }\\..\\Forms.xls" Sheet1!Page02 \p \* MERGEFORMAT }
...
{ LINK Excel.Sheet.8 "{ filename \p }\\..\\Forms.xls" Sheet1!Page24 \p \* MERGEFORMAT }