How To Paste Multiple Objects To A Slide in VBA

Поделиться
HTML-код
  • Опубликовано: 29 дек 2024

Комментарии • 25

  • @donballesteros1744
    @donballesteros1744 4 года назад +1

    Hi. This is a great help. I do have a need to (1) use my own ppt template with some logos (2) transfer all charts in an excel workbook and paste it in specifical slide pages while (3) positioning each of those objects/charts in the targetted slides. You were mentioning this in your video and was hoping you that solution also. MANY THANKS!!!!

  • @studentstudent1393
    @studentstudent1393 2 года назад

    How do u take an array of sheet data from excel to ppt as an object paste, and have it autofit the slide in standered size, formatting maximum fit?

  • @rfrost8551
    @rfrost8551 4 года назад

    Thanks. I've watched quite a few of the other links now and its making some sense. If you could do an example where the objects, tables, charts, their dimensions, their intended slide number and positioning is stored in a table then JACKPOT, i get some years of my life back. Thanks again for the excellent examples you've walked through. THANKS :)!!

  • @TY2CD
    @TY2CD 3 года назад

    Thanks! How do I select different columns from a sheet and paste them to a slide as one sheet in stead of two separate ranges?

  • @MrKanakou
    @MrKanakou 2 года назад

    at the end of creating the pptx presentation, it appears there is no way (in the script) to save it. It appears that "this application" refers to the excel vba script - and cannot be switched to point to the pptx presentation.......... is that right? (needless to say, one just hops over to the open pptx presentation and saves it manually, . . . . but it seems more cool to put that into the script, no?

  • @darkstar218
    @darkstar218 2 года назад

    Hi, thank you for these videos. Wish I knew about them 3 years ago. When you are defining the dimensions array, how do you get those measurements you wrote down?

  • @Nahidchy91
    @Nahidchy91 4 года назад

    Hi I'm able to copy paste the shapes in specific Slide however I want to change the dimension of a specific shapes in a specific slide so help me on this.
    Thanks.

  • @santoshvutukuri8855
    @santoshvutukuri8855 5 лет назад +1

    Awesome and It helped me to put a structure to my approach

    • @SigmaCoding
      @SigmaCoding  5 лет назад

      Wonderful, that's the goal give enough info just to make some dangerous! ;)

  • @michaeljohnston9713
    @michaeljohnston9713 4 года назад +1

    What if your object you want to grab is a pivot tabe? How would you list that in the ObjArray and copy area of the code?

    • @SigmaCoding
      @SigmaCoding  4 года назад

      I have a video about copying Pivot Tables to Outlook. That should get you in the right direction: ruclips.net/video/JjbvTngTr-M/видео.html

  • @shueybamin5244
    @shueybamin5244 4 года назад

    Hi, this is great, however after playing around with this, I'm getting stuck. After running it first time to create a PowerPoint Presentation as per this code, how do I then add it to the next slide if I were to run the code again?

  • @bjiuann
    @bjiuann Год назад

    1) How to export Group chart?
    2) I have about 4 group charts with respective table in one sheet and I have them in multiple sheets. How to combine this "Paste Multiple Objects To A Slide in VBA" with "Exporting Multiple Excel Charts To PowerPoint Using VBA"?
    Thank you.

  • @meenakshisundaramthambusam7499
    @meenakshisundaramthambusam7499 2 года назад

    ObjArray = Array(Sheet1.Range("B2:D5"), Sheet1.ChartObjects(1), Sheet1.ListObjects(1))

  • @stacycereceres
    @stacycereceres 5 лет назад +1

    Hi. At the end of your video you mentioned that you were going to make a video where you could go through multiple worksheets and copy charts/ranges/etc. I was looking through the videos but I don't think I've seen anything like this. Have you made one like this? I can make 2 ppt slides but it doesn't copy anything over.

    • @SigmaCoding
      @SigmaCoding  5 лет назад +1

      Yes, I cover how to copy all sorts of objects over to PowerPoint! Here is a link to the playlist.
      *ruclips.net/p/PLcFcktZ0wnNlFcSydYb8bI1AclQ4I38VN*
      That was actually the first topic I ever covered on the channel, so its bury deep inside the video list.

  • @nickthomas8952
    @nickthomas8952 4 года назад +1

    Thanks for the video! This is super helpful. I am attempting to create an instance of Powerpoint and then open a file template to begin editing that template. I can create the instance of powerpoint, but then once I attempt to open my template Powerpoint crashes and then Excel hangs waiting for external OLE object that is no longer available. Here is my code:
    Set PPTApp = New PowerPoint.Application
    PPTApp.Visible = True
    PPTApp.Activate
    Application.Wait (Now + TimeValue("00:00:05"))
    'MsgBox ("Test Complete")
    Set PPTDoc = PPTApp.Presentations.Open(RootPath & "MyFile.pptx")

    • @SigmaCoding
      @SigmaCoding  4 года назад

      So what happens when you open the PowerPoint template manually? Does it cause issues? Also, since it's crashing you might want to add an If-statement that quits the script if the "PPTApp" is none.

  • @michaeljohnston9713
    @michaeljohnston9713 4 года назад +1

    What if you had an existing PPT with objects. I have figured out how to open the existing PPT (not sure if New before PowerPoint. Application was the correct syntax but it worked).
    'Open Instance of PowerPoint
    Set PPTApp = New PowerPoint.Application
    PPTApp.Visible = True
    PPTApp.Presentations.Open "C:\Users\mjohnston\Desktop\Presentation1.pptx"
    PPTApp.Activate
    However, how do you delete all objects on that slide before pasting new ones? I keep receiving "activex component can't create object" when looking at other online sources for deleting objects.
    The PPT will be approximately 20 slides with 1-3 objects on each. I plan on creating a unique macro for each slide that will be visible on each excel sheet via a button (this I can do).

    • @SigmaCoding
      @SigmaCoding  4 года назад +1

      Are you storing your presentation in an object variable? Right now, you just open it, but you don't store it in a variable. That would make it hard to delete all the objects.

    • @michaeljohnston9713
      @michaeljohnston9713 4 года назад

      Thanks! Got it!

  • @ghli888
    @ghli888 4 года назад

    Hi , What should be done if we were looking to do this to the active powerpoint presentation we have open, instead of pasting to a new presentation as described in the video?

    • @SigmaCoding
      @SigmaCoding  4 года назад +1

      The only section of code that would change is the following:
      'Create a new instance of PowerPoint
      Set PPTApp = New PowerPoint.Application
      PPTApp.Visible = True
      'Create a new presentation
      Set PPTPres = PPTApp.Presentations.Open("C:\Users\305197\Desktop\ShapeFinder.pptm")
      That section creates a new PowerPoint Application object, makes it visible, and opens an existing presentation file that is saved somewhere on the system. To grab the "Active Instance" of the PowerPoint and then Reference the "Active Presentation" you would do the following:
      'Test if PowerPoint is Open, this portion is more for "safety". I can't paste to a presentation if PowerPoint isn't open.
      Set PPTApp = GetObject(, "PowerPoint.Application")
      'If the Application isn't open it will return a 429 error
      If Err.Number = 429 Then
      'It's not open, so let's create a new instance of the application.
      Err.Clear
      Set PPTApp = New PowerPoint.Application
      PPTApp.Visible = True
      End If
      'Grab the Active Presentation
      Set PPTPres = PPTApp.ActivePresentation
      Be careful whenever you work with the "Active Instance" of a Presentation, Workbook, or Document. The "Active Instance" usually means the one that you are currently editing and have a cursor focused in. That means if the user had multiple presentations opened and then didn't have their mouse in the correct one, then it potentially not work.

    • @ghli888
      @ghli888 4 года назад

      @@SigmaCoding Thank you for the feedback this is very helpful!

  • @meenakshisundaramthambusam7499
    @meenakshisundaramthambusam7499 2 года назад

    this particular line not working bro