Consulting

Results 1 to 3 of 3

Thread: Running procedures stored in variables

  1. #1
    VBAX Regular
    Joined
    Feb 2012
    Posts
    41
    Location

    Running procedures stored in variables

    Using PowerPoint 2010 I am trying the run a procedure stored in a variable. The procedure is stored in a Module. It looks like others have done this with the "Run" command--at least in Excel. However, when I try to execute the command: "Run tNames(i)" from a control procedure called "InitiateTemplate" I get an error message that says:

    "Cannot run the macro 'Cover'. The macro may not be available in this workbook or all macros may be disables"

    The procedure is contained in a different Module, but I've doubled checked and it is indeed named "Sub Cover()". Is there a way to call this procedure using a variable name from a procedure in a different module?

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Try Application.Run tNames(i)
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    VBAX Regular
    Joined
    Feb 2012
    Posts
    41
    Location
    Like your other solutions, worked like a charm. Thanks.

Posting Permissions

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