locked
VBA Project / locked protected in Office 2010...no programmatic access RRS feed

  • Question

  • We are trying to upgrade to Office 2010 from 2003.  We have hit a stumbling block with some custom VBA code - we have a Word Wizard VBA project that works with Word templates we have created.

    Basically it works like this - we have a macro in word that fires a VBA project in a template.  This VBA project is our custom 'Word Wizard' - it works dynamically with the VBA code in each of the templates.  The wizard opens up a form, displays a list of departments (folders on our network drive), the user selects a department - the wizard displays forms (templates) for the user to pick - and then is supposed to walk the user through supplying the values needed to create a document from the chosen template.

    After the user has selected a particular template, the Word Wizard VBA code adds the document (it appears in the project browser when stepping through the code)then loops through its references to see if the VBA project inside the chosen template is already referenced - if it is, the reference is removed - then, the reference is added back into our Word Wizard VBA project so the two projects can communicate.

    As soon as the reference is added, the template VBA project (which is visible in the Project Browser) collapses - and it protects the VBA project.

    I have opened up the security I believe as far as I can - allow access to VBA project.  Allow Macros.  Disabled 'Enable Data Execution Mode'.  Set up Trusted locations...on and on.

    Is there a setting I am missing somewhere to turn this protection off?

     

    Thursday, February 24, 2011 3:27 PM

Answers

  • Problem resolved.  Change in the object model threw some of the code off.  Needed to issue a line to Open the template (before it was just being added) - and all is well.

    Thanks to anyone who spent time on this.

    • Marked as answer by 许阳(无锡) Monday, February 28, 2011 5:13 AM
    Friday, February 25, 2011 8:17 PM

All replies

  • Problem resolved.  Change in the object model threw some of the code off.  Needed to issue a line to Open the template (before it was just being added) - and all is well.

    Thanks to anyone who spent time on this.

    • Marked as answer by 许阳(无锡) Monday, February 28, 2011 5:13 AM
    Friday, February 25, 2011 8:17 PM
  • Hi ..pmh,

    I’m glad to hear you resolve your issue. Thanks for sharing your experiences here, and it will be very beneficial for other community members who have similar questions to see how you have dealt with your issue.

    Have a great day,

    Tom Xu


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, February 28, 2011 5:13 AM