#1
|
|||
|
|||
Macro to link to another powerpoint presentation
Does anyone have a written macro that I can run in a powerpoint show to link to another show and close the show just completed?
|
#2
|
|||
|
|||
You need to be careful as the windows may not open in the correct order but this should work and give a start.
Sub newshow() Dim nextpres As Presentation SlideShowWindows(1).Parent.Windows(1).WindowState = ppWindowMinimized SlideShowWindows(1).View.Exit Set nextpres = Presentations.Open("C:\Users\John\Desktop\bug.pptx ") nextpres.Windows(1).WindowState = ppWindowMinimized nextpres.SlideShowSettings.Run End Sub |
#3
|
|||
|
|||
tried it....couldn't get it to work....I just don't know VBA that well....no biggy, the user will just have to close the program on their own....
|
#4
|
|||
|
|||
Set nextpres = Presentations.Open("C:\Users\John\Desktop\bug.pptx ")
You did set the path to be a file on your PC? |
#5
|
|||
|
|||
actually, the files reside on a server.....I placed the target path of the server on the line you stated...
|
#6
|
|||
|
|||
Does anything happen when you click the button that runs the code?
|
#7
|
|||
|
|||
nothing....I am linking from a slideshow on my computer to a slideshow on the server...The show doesn't close and the other doesn't open...
|
#8
|
|||
|
|||
we are talking Office 2007 also...
|
#9
|
|||
|
|||
Should work in 2007. It sounds like whatever you are doing in not running the macro at all.
If you insert this MsgBox "OK,I'm running" Like this: Sub newshow() Dim nextpres As Presentation Msgbox "OK,I'm running" SlideShowWindows(1).Parent.Windows(1).WindowState = ppWindowMinimized SlideShowWindows(1).View.Exit Set nextpres = Presentations.Open("C:\Users\John\Desktop\bug.pptx ") nextpres.Windows(1).WindowState = ppWindowMinimized nextpres.SlideShowSettings.Run End Sub If you don't see the message then the button is not running the code and you need to investigate why. |
#10
|
|||
|
|||
OK....I inserted the line and the box appears...I went to the developer screen and ran it and it appears, but I get a
run time error '2147188160 (800482240) SlideShowWindows (unknown member) : Interger out of range. 1 is not in the valid range of 1 to 0...the debugger highlights the line right under the msgbox line... |
#11
|
|||
|
|||
OK is this a ppsx file maybe.
The purpose of both the minimise lines is to make sure the edit window is not in front. You can probably delete at least the first one probably both. If you have a ppsx there is no edit widow of course and it will error. |
#12
|
|||
|
|||
I saved it as a ppsm and tried it.....the i am running window opens but the program doesn't close or the other doesn't open....
|
#13
|
|||
|
|||
I was suggesting it WONT work with a ppsm.
Try removing the two lines that minimise the window Sub newshow() Dim nextpres As Presentation Msgbox "OK,I'm running" SlideShowWindows(1).View.Exit Set nextpres = Presentations.Open("your full path ") nextpres.SlideShowSettings.Run End Sub |
#14
|
|||
|
|||
OK....I did what you said, and it works if I run a show right from the ppt....I tried saving it in ppsx and ppmx and ran it and it doesn't work...
|
#15
|
|||
|
|||
so getting close...
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
rotate my ENTIRE powerpoint presentation | zachary | PowerPoint | 2 | 03-26-2012 06:28 AM |
PowerPoint Stops Presentation | JimAllen | PowerPoint | 0 | 01-30-2012 05:23 PM |
Business Powerpoint Presentation | Corneb | PowerPoint | 0 | 01-23-2012 01:45 AM |
music loop in powerpoint presentation | genoMU69 | PowerPoint | 1 | 06-15-2011 08:00 AM |
PowerPoint Presentation Resource | lux | Office | 2 | 07-28-2005 02:09 AM |