Consulting

Results 1 to 11 of 11

Thread: Excel Chart & Tables paste in PPT through Macro

  1. #1

    Excel Chart & Tables paste in PPT through Macro

    Dear Pual sir,

    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

    any idea?

    Regards
    Amar

  2. #2
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    Hi amartakale!
    This is not a good enough example, but maybe it can help you.
    Attached Files Attached Files

  3. #3
    Good Morning sir

    thanks but nothing any action do by click on commomd button

    then waht I do?

  4. #4
    I found below link on google.It is useful?

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=370



    1. While in the VBE, choose Tools - References and put a check in Microsoft PowerPoint X.X Object Library.


    but Microsoft PowerPoint X.X Object Libraryhow not show in my pc then how to install this in pc

  5. #5
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    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.

  6. #6
    If I click button nothing happen

  7. #7
    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

    Next x


    End Sub

  8. #8
    Dear Sir

    Pls can you do this..............

    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.

  9. #9
    VBAX Mentor 大灰狼1976's Avatar
    Joined
    Dec 2018
    Location
    SuZhou China
    Posts
    479
    Location
    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.
    Attached Files Attached Files

  10. #10
    thanks sir for your effort

  11. #11
    Dear Pual Sir ,Can you look in this matter?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •