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):
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