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
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
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
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.![]()
Please Login or Register to view this content.
If you can provide the code, I can be more specific if necessary!
Don
Please remember to mark your thread 'Solved' when appropriate.
Many thanks!![]()
Please Login or Register to view this content.
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.
OK. So the PowerPoint code needs to change to this
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.
![]()
Please Login or Register to view this content.
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.
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.
You might disable events in the Excel macro, run the PP macro, then re-enable events.
Works!
Many thanks xlnitwit, I was beginning to think this wasn't possible!
You're welcome.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks