+ Reply to Thread
Results 1 to 3 of 3

Updating ActiveX Labels Before Save

  1. #1
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Question Updating ActiveX Labels Before Save

    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:
    Please Login or Register  to view this content.
    Module2:
    Please Login or Register  to view this content.
    EventClassModule:
    Please Login or Register  to view this content.
    Module1:
    Please Login or Register  to view this content.
    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

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Updating ActiveX Labels Before Save

    Cross-posted (and answered) at: http://www.msofficeforums.com/word-v...fore-save.html
    Please read Excel Forum's Cross-Posting policy in rule 8: http://www.excelforum.com/forum-rule...rum-rules.html
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    07-28-2015
    Location
    Danville, IL USA
    MS-Off Ver
    2013
    Posts
    34

    Re: Updating ActiveX Labels Before Save

    Thank you for the pointer!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Updating Secondary X-Axis Labels
    By TimlmiT in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 08-10-2018, 05:18 PM
  2. Excel not updating line graph labels
    By wmjenner in forum Office 365
    Replies: 3
    Last Post: 10-20-2017, 02:04 PM
  3. Replies: 2
    Last Post: 03-29-2013, 01:25 PM
  4. ActiveX Control labels and text
    By bscdave in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2012, 03:50 PM
  5. ActiveX Dropdown Box problem on Save AS
    By cincyfire in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-28-2009, 06:16 PM
  6. Chart axis labels not updating properly with VBA
    By d3hartm2 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-05-2009, 12:10 PM
  7. Help with updating labels on form
    By barkerx5 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-30-2008, 10:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1