Greetings,
I've done some VBA programing in Excel with help from Google and the Excel Forum on this website. This is my first attempt to use VBA in Word.
I have a form with 3 ActiveX labels. The labels get updated based on the condition of a series of radio buttons that the user checks off. The problem is that checking the radio buttons does not trigger the macros that update the labels, and changes to the state of multiple buttons at the same time are what trigger the updating of the Labels.
My solution is to have the macros run every time the user saves the document. Here is what I have so far.
ThisDocument:
Module2:
EventClassModule:
Module1:
My problem is that the three individual Subs that are executed by by Status_Update in Module1 all hang at the lines indicated in red. This happens whether I trigger them by Saving the document, or by individually running each of the 3 Subs from the VBE. In each case I get a 424 Object Required error and I'll be darned if I can figure out why. If anyone can help me understand why this is happening, and how to fix it, I would be most appreciative.
I am aware that there are more elegant ways to structure this coding, but as a relative newbie I find it easier to build and debug small Subs and then string them together.
Although I haven't gotten the Module1 Status_Update macro to run without errors, in my debugging efforts it seems that the Before Save event will run only once and then the document must be closed and reopened to be able to execute it again. I need it run the macros every time the save button is pressed, not just the first time. I'm not sure of this because I haven't actually had a bug free run yet. Is this a correct observation, and if so, is there a way around it? Again, any help is appreciated.
Lastly, I recognize that my whole approach could be flawed, and that there may be a better way to get the three Labels to update other than by using the BeforeSave event.
Thanks in advance for any assistance offered. I realize your time is valuable, and I'm grateful to those who take the time to help folks like me.
~ Phil
Bookmarks