Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pasting as Hyperlink from Excel to PPT

Status
Not open for further replies.

jamie72

Technical User
Jul 24, 2003
4
IT
HI all!
After having pasted a chart as picture from Excel in PPT I also need to paste its correct path. I don't want an open link with Excel. The trouble is it gets paste as a picture and NOT as text. VBA for Excel doesn't like AddLabel.

Here's what I tried.... (using a variation on some code you probably all know pretty well):

Code:
Sub addchartsource()
    
‘get file info to copy over to PPT
 Range("A65536").FormulaR1C1 = "=CELL(""filename"",R[-1]C)"
     Range("A65536").Copy
    Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
        False, Transpose:=False
     
Dim PPApp As PowerPoint.Application
Dim PPPres As PowerPoint.Presentation
Dim PPSlide As PowerPoint.Slide

If Not TypeName(Selection) = "Range" Then
    MsgBox "Please select a worksheet range and try again.", vbExclamation, _
        "No Range Selected"
Else
    ' Reference existing instance of PowerPoint v.9
    Set PPApp = GetObject(, "Powerpoint.Application.9")
    ' Reference active presentation
    Set PPPres = PPApp.ActivePresentation
    PPApp.ActiveWindow.ViewType = ppViewSlide
    ' Reference active slide
    Set PPSlide = PPPres.Slides(PPApp.ActiveWindow.Selection.SlideRange.SlideIndex)
       
 Range("A65536").Copy
 PPSlide.Shapes.Paste.Select
    
    Set PPSlide = Nothing
    Set PPPres = Nothing
    Set PPApp = Nothing
End If

End Sub

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top