Consulting

Results 1 to 4 of 4

Thread: Calling functions and subs from another file

  1. #1

    Calling functions and subs from another file

    Hi.

    Having a lot of power point macros that clips in images and other stuff. All of them have a lot of functions and subs to do stuff (like comparing files, getting the newest file, aligning and so on) so the main code will be more easy to handle and maintain for some people not so into the VBA code.
    This works great, but - if i wan't to update the subs and functions, i have to put the the updated code in EVERY macro and that is a pain in the ---.
    So, is it possible to have the macro calling the functions from another file (like "Reference_Macro.whateverisneeded") so all the updates goes into that single file instead?

    I can't install special software and that kind of stuff (at work you know...).

    If this is possible, how do i implement this?

    Regards X.
    Last edited by Xanthopteryx; 05-11-2019 at 01:06 AM.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    The best way to do this is to write a ppam AddIn with ribbon controls that make it available to all users.

    You can though call code in other open presentations using
    Application.Run ("the name of the code sub routine")
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    Quote Originally Posted by John Wilson View Post
    The best way to do this is to write a ppam AddIn with ribbon controls that make it available to all users.

    You can though call code in other open presentations using
    Application.Run ("the name of the code sub routine")
    Thank you.

    The ribbon AddIn, how does that work?

    Regards X.

  4. #4
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    There is a very basic tutorial on our site but there is a learning curve.

    Although it's for 2007 it also works the same in later versions.

    http://www.pptalchemy.co.uk/custom_UI.html
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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