Here's what I think you're saying, jmaxcy:
You're referring to three sources: an Excel workbook (which I'll name E.xlsx), a "current" Word document (C.docx) and a series of quarterly Word documents (which I'll named 2013Q1.docx, 2013Q2.docx and so on). From time to time someone goes into E.xlsx, goes to a worksheet there (let's say SheetD) and types a date into one of its cells (D5). At that point you want C.docx to reflect the information from whichever of the quarterly Word documents corresponds to that date, so if the user entered 2012-09-15, C.docx is updated so that certain text from 2012Q3.docx is copied manually into C.docx.
But you'd like to know whether it's possible for this to happen automatically. Now, certainly part of it can be automated. For example, you can write a VBA or VBS program that looks at the date in [E.xlsx]SheetD!D5, translates that date to the name of a new quarterly Word report (say "2013Q2.docx"), opens that report and C.docx, copies certain text from 2013Q2.docx into C.docx and saves the changed result. After that, anyone who opens C.docx will see the updated information.
First, is that what you're asking?
And second, that would be an improvement on what you're doing now, especially if you have to do it fairly often. But it does mean that someone would have to remember to run the program. Is there a way for this to happen even more automatically?
Maybe. I can think of two possibilities:
1) Write an Excel VBA program in E.xlsx (only now it's going to be E.xlsm, because it'll contain a program) that runs automatically when anyone changes the value of [E.xlsm]SheetD!D5. That would be a Worksheet_Change subroutine; it would have to look at the date, then open and change and close the two Word documents. That can be done.
2) I think it's possible to write the program in C.docx, so that whenever it's opened it checks the contents of [E.xlsx]SheetD!D5 and updates itself if necessary. I wouldn't do it this way for several reasons:
a) It has to check the contents of E.xlsx every time it's opened, whether E.xlsx has been updated or not. If you have the program reside in E.xlsm, then it can be made to run only when the date is changed.
b) Back in the Bad Old Days when Microsoft first invented the ability of Office documents to run programs automatically upon certain events—such as opening the document—lots of clever rascals wrote viruses that were transferred by such methods, doing lots of damage to trusting workplaces. MS Office is smarter about that now: When it sees a VBA program in a document it's opening, it usually stops and asks the user whether it should allow the program to run; and because of the old virus problem, informed users invariably answer "no" (often with various adverbs for emphasis). It's possible to get around that by using digital certificates to sign those programs, and then informing Word that it may run properly signed programs without worrying the user, but that's a lot of work.
I said "several" reasons and I think I had a third one in mind, too, but just now I can't remember what it might have been. But anyway, if you want it to run automatically I'd do it in Excel, not Word.
|