Consulting

Results 1 to 3 of 3

Thread: Command Buttons

  1. #1
    VBAX Newbie
    Joined
    Mar 2021
    Posts
    5
    Location

    Command Buttons

    Hello all,

    I have created a dotm with several tables that are inserted via macro. The tables are saved as QuickParts and each has a command button. Periodically when testing the document by opening a docm and inserting a table, the command button is gone and is replaced with the following text: "Error! Objects cannot be created from editing field codes." I created the command buttons from the developer tab, using the ActiveX command buttons, so I don't know what to make of this error message and how to stop this from happening?

    Thank you!

  2. #2
    If you create a new document from a template the code remains in the template and can only be used as long as the document has access to the template.
    Frankly I wouldn't use Active X command buttons. They are a throwback to Word's ability to create html documents, It would be better to create a ribbon tab for your template - http://gregmaxey.mvps.org/word_tip_p...bbon_main.html or you could add a userform to your template and use that to select which tables are added to the document.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Contributor
    Joined
    Jul 2020
    Location
    Sun Prairie
    Posts
    123
    Location
    Personally, I would prefer to assign the macros to QAT buttons instead of Command Butons. It is much simpler.
    Modifying the Quick Access Toolbar (QAT) in Microsoft Word
    This would still require that the document remain attached to the template containing the macros and QAT modifications. (A custom ribbon tab is more elegant but also more work.) If you want to use a UserForm, you may want to look at Graham's page: Create a Simple Userform.

Posting Permissions

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