I am building a macro that will copy a selection of data based on the date entered, pull up an existing, saved powerpoint, and paste that chart into the second slide of the powerpoint. So far, my macro will select and copy the proper chunk of data and open the correct powerpoint. It breaks at the commands to select the second slide and returns "runtime error "91" Object variable or With block variable not set. I am attaching the file here hoping that it will make helping me easier.
Here's the current code:
'Works for February Tab
Sub CreateStaffTemplate()
With Worksheets("Feb")
Select Case .Range("C20").Value
Case .Range("B4").Value: .Range("B6:D15").CopyPicture Appearance:=xlScreen, Format:=xlPicture
Case .Range("F4").Value: .Range("F6:H15").Copy
Case .Range("J4").Value: .Range("J6:L15").Copy
Case .Range("N4").Value: .Range("N6:P15").Copy
End Select
End With
Dim PPT As PowerPoint.Application
Dim myShapeRange As PowerPoint.Shape
Dim myPresentation As PowerPoint.Presentation
Dim ppSlide As PowerPoint.Slide
Dim SlideNum As Integer
Set PPT = New PowerPoint.Application
PPT.Visible = True
PPT.Presentations.Open Filename:="C:\Users\vk307d\Desktop\Staff Meeting Template.pptm"
PPT.Activate
Set PPT = GetObject(, "Powerpoint.Application")
myPresentation.Slides(2).Shapes.Paste
Bookmarks