+ Reply to Thread
Results 1 to 10 of 10

Passing Variable Value to Power Point Procedure

  1. #1
    Registered User
    Join Date
    12-01-2015
    Location
    Selby
    MS-Off Ver
    2013
    Posts
    66

    Passing Variable Value to Power Point Procedure

    I have some code that opens a PP file and then executes a macro withing the PP file.

    Within the PP macro I need the value of a variable established in the Excel macro.

    Is there anyway of passing this from Excel to PP?


    TIA

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Passing Variable Value to Power Point Procedure

    Hi,

    It should be possible to adjust the macro in PP to take a parameter and then pass the relevant value when you call it from Excel. You need only adjust the PP macro from
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    and you may then use someValue in the PP code and pass a value from Excel when you call it.

    If you can provide the code, I can be more specific if necessary!
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    12-01-2015
    Location
    Selby
    MS-Off Ver
    2013
    Posts
    66

    Re: Passing Variable Value to Power Point Procedure

    Please Login or Register  to view this content.
    Many thanks!

  4. #4
    Registered User
    Join Date
    12-01-2015
    Location
    Selby
    MS-Off Ver
    2013
    Posts
    66

    Re: Passing Variable Value to Power Point Procedure

    The code already posted is in the PP file.

    The code below is the code that opens the PP file and executes the PP macro
    Please Login or Register  to view this content.

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Passing Variable Value to Power Point Procedure

    OK. So the PowerPoint code needs to change to this
    Please Login or Register  to view this content.
    and the Excel code only needs to change this
    Please Login or Register  to view this content.
    to this
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor IonutC's Avatar
    Join Date
    01-28-2016
    Location
    Bucharest, Romania
    MS-Off Ver
    Office 2019
    Posts
    486

    Re: Passing Variable Value to Power Point Procedure

    xlnitwitt you are good man!
    Please consider:
    Be polite. Thank those who have helped you.
    Click the star icon in the lower left part of the contributor's post and add Reputation. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .
    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

  7. #7
    Registered User
    Join Date
    12-01-2015
    Location
    Selby
    MS-Off Ver
    2013
    Posts
    66

    Re: Passing Variable Value to Power Point Procedure

    Super!!

    But one problem, when the new source file line (.SourceFullName = strNewLink) is executed, Excel opens a copy of the original source file twice.

    Now as I have some code in Workbook_Open of the file, this is executing and you can't turn off enableevents in PP........

    The workbook_open code in the Excel needs to stay there but I thought about having a boolean variable in the Excel file module that is set to true (boolLinking = TRUE) and put an if statement in the workbook_Open to exit if true.

  8. #8
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Passing Variable Value to Power Point Procedure

    You might disable events in the Excel macro, run the PP macro, then re-enable events.

  9. #9
    Registered User
    Join Date
    12-01-2015
    Location
    Selby
    MS-Off Ver
    2013
    Posts
    66

    Re: Passing Variable Value to Power Point Procedure

    Works!

    Many thanks xlnitwit, I was beginning to think this wasn't possible!

  10. #10
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Passing Variable Value to Power Point Procedure

    You're welcome.

+ 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. Export power View to Power Point
    By Trinhhai in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-09-2014, 05:32 AM
  2. Passing a variable from a Procedure to a Function
    By Hellga in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-01-2013, 10:30 AM
  3. Passing Array Data To Another Procedure
    By punter1000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2011, 02:17 AM
  4. Passing an Array to a another Procedure
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2010, 05:46 PM
  5. passing commandbars to a procedure
    By Doug Glancy in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-11-2006, 08:15 PM
  6. [SOLVED] how to use power point
    By sara benson in forum Excel General
    Replies: 2
    Last Post: 12-12-2005, 11:55 AM
  7. PASSING VARIABLE TO .xlT FILE FROM .xlA FILE (CONTAINS 'Auto_Open' PROCEDURE)
    By Chuckles123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-09-2005, 02:31 PM

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