Hyperlink from Excel Presentation in edit mode

N

Nickis

I'm using Office 2003 and need to add a hyperlink in Excel VBA to open a
Powerpoint Presentation in edit mode, on a specific slide. Currently the
hyperlink is opening in slideshow view, slide 1.

I'm using early binding to control Powerpoint from Excel to perform copy
paste functions. The basic code I'm using for the copy paste is posted
below. It's working well if I have the presentation open in edit mode
already and also have the correct slide selected, but I would like to
hyperlink and have the copy paste code run automatically. The code I'm
trying to use for the hyperlink is pasted below too.

'COPY PASTE CODE THAT WORKS

Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide

Set PPApp = GetObject(, "Powerpoint.Application")

Set PPPres = PPApp.ActivePresentation

'Reference active presentation
PPApp.ActiveWindow.ViewType = ppViewSlide

'Reference active slide
Set PPSlide =
PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)

Sheets("template").Select
Range("C3").Select
Selection.Copy

PPSlide.Shapes.Paste.Select


'HYPERLINK CODE THAT OPENS IN SLIDESHOW VIEW

ActiveSheet.Range("e10").Hyperlinks(1).Follow

Thanks for any help.

Nicki
 
B

Bill Dilworth

Hi Nicki,

Since you are already using early binding, I would not bother to go thru
hyperlinking. Instead grab the name of the PowerPoint (from the e10 cell),
open it (making it visible), then goto slide X. Like this ... (watch for
text wrapping)


With Presentations.Open("C:\Test.ppt", msoFalse, msoFalse, msoCTrue)
With .Windows(1)
.View.GotoSlide 4
.ViewType = ppViewNormal
.WindowState = ppWindowMaximized
End With
End With

Bill Dilworth
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top