+ Reply to Thread
Results 1 to 6 of 6

Run an Excel Macro From PowerPoint VBA

  1. #1
    Registered User
    Join Date
    07-06-2018
    Location
    united states
    MS-Off Ver
    2016
    Posts
    8

    Run an Excel Macro From PowerPoint VBA

    Hi everyone, I have what I think may be a simple question. I currently have a macro written in excel. What I am trying to do is open the excel file if it is not already open, and then run the excel macro all from powerpoint vba. I think I have the opening of the file correct, but can not figure out the syntax in powerpoint vba to call an excel macro. Can anyone please help? This is what I have so far, and it does not work with "xlApp.Run Macro1"
    Please Login or Register  to view this content.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,691

    Re: Run an Excel Macro From PowerPoint VBA

    I have not tested this but I think this will do it:
    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,691

    Re: Run an Excel Macro From PowerPoint VBA

    If the files are not in the same folder then you may need:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-06-2018
    Location
    united states
    MS-Off Ver
    2016
    Posts
    8
    Quote Originally Posted by 6StringJazzer View Post
    If the files are not in the same folder then you may need:

    Please Login or Register  to view this content.

    Thank you I will try this on Monday and let you know if it works or not!

  5. #5
    Registered User
    Join Date
    07-06-2018
    Location
    united states
    MS-Off Ver
    2016
    Posts
    8

    Re: Run an Excel Macro From PowerPoint VBA

    Quote Originally Posted by 6StringJazzer View Post
    If the files are not in the same folder then you may need:

    Please Login or Register  to view this content.
    Hi thank you again for the reply. I tried both the fullname and name on that line of code, and I am receiving an error. "Run time error '1004': Cannot run the macro "C:\Users\NA54994\Documents\My Received Files\Test.xlsm'!'. The macro may not be available in this workbook or all macros may be disabled"

    Macros are enabled and the macro is showing in the developer tab. Any thoughts on how to fix this?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Run an Excel Macro From PowerPoint VBA

    In that code Macro1 is a variable, rather than the name of the macro to be run.
    Either assign the macro name to the variable or better yet include Macro1 in the text

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

+ 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. [SOLVED] copy past table from excel to powerpoint - keep powerpoint formatting
    By djc225 in forum PowerPoint Formatting & General
    Replies: 2
    Last Post: 10-30-2018, 11:32 AM
  2. Replies: 0
    Last Post: 08-23-2016, 09:43 AM
  3. Replies: 1
    Last Post: 06-09-2016, 12:05 PM
  4. Replies: 6
    Last Post: 08-18-2015, 06:39 AM
  5. Excel/PowerPoint VBA teaser: How to change data labels in PowerPoint chart by VBA?
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-12-2015, 11:47 AM
  6. VBA Transfer Range from Excel to Powerpoint (New or Existing Powerpoint Presentation)
    By ThePeoplesClub in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-14-2014, 02:52 PM
  7. Replies: 13
    Last Post: 01-11-2013, 04:46 PM

Tags for this Thread

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