I have One excel where there are more than 20 sheet include chart & chart tables when I run code then vba code make all chart as paste special as picture object in first sheet of excel then I copy all chart & chart tables serially one by one & paste in PPT file as per name of title PPT name.
I want VBA code like this that all chart & table copy from excel which is object in first sheet then automatically paste in PPT as per title name after click button
I open both sheet excel & PPT then in excel only click button
My code is very similar to that on the webpage you posted.
is there any error messages when run the code?
Do you confirm if you have opened PPT as you said.
Actually I want multiple chart & tables paste in PPT as per slide name match OR Slide number by code in shot.
I found another code on web
I found another Code on Google,is is this useful?
Sub PasteMultipleSlides()
Dim myPresentation As PowerPoint.Presentation
Dim mySlide As PowerPoint.Slide
Dim MySlideArray As Variant
Dim MyRangeArray As Variant
'List of PPT Slides to Paste to
MySlideArray = Array(1, 3, 5, 7)
'List of excel ranges copy from
With ThisWorkbook.Worksheets("Sheet1")
MyRangeArray = Array(.Range("A1:B5"), .Range("C15"), _
.Range("E1:F5"), .Range("G1:H5"))
End With
'Loop through Array data
For x = LBound(MySlideArray) To Bound(MySlideArray)
'Set variable to desired slide
Set mySlide = myPresentation.Slides(MySlideArray(x))
'Copy Excel Range
MyRangeArray(x).Copy
'Paste Into PowerPoint
mySlide.Shapes.PasteSpecial DataType:=ppPasteEnhancedMetafile
I have Already one my confidential excel sheet where in first sheet (Name:Paste) all chart & tables paste in first sheet as per picture object through VBA (Record Macro). I want only this all picture object chart & tables paste in my PPT as per slide name OR slide numbers through code in one shot.
Can you prepare sample excel with this code & create PPT in one folder & Click button then all chart & table paste in PPT as per slide numbers automatically then I will do like this in my work same. but remember in code must include PPT name bcos then I change this with my PPT Name.
I'm sorry I forgot to add macros in the button.
Please refer to the attached again.
But this is not a finished product, but a simple example as you know.