+ Reply to Thread
Results 1 to 2 of 2

excel to powerpoint automation

  1. #1
    Registered User
    Join Date
    10-21-2021
    Location
    New Delhi
    MS-Off Ver
    MS Office 2016
    Posts
    6

    excel to powerpoint automation

    Just getting "Report Completed" msg at last but data is not pasted in PPT Slides. Any help


    Sub Create_PPT()

    Dim myPresentation As Object
    Dim mySlide As Object
    Dim PowerPointApp As Object
    Dim shp As Object
    Dim mySlideArray As Variant
    Dim myRangeArray As Variant
    Dim x As Long
    Dim wb As Workbook
    Dim sh1 As Worksheet
    Dim sh2 As Worksheet
    Dim sh3 As Worksheet
    Dim sh4 As Worksheet
    Dim sh5 As Worksheet
    Dim sh6 As Worksheet


    Set wb = ActiveWorkbook
    Set sh1 = ThisWorkbook.Sheets("Close")
    Set sh2 = ThisWorkbook.Sheets("Trend")
    Set sh3 = ThisWorkbook.Sheets("Total_Cloud_Chart")
    Set sh4 = ThisWorkbook.Sheets("AWS_Summary_Chart")
    Set sh5 = ThisWorkbook.Sheets("Compute_Chart")
    Set sh6 = ThisWorkbook.Sheets("Storage_Chart")

    On Error Resume Next

    Set PowerPointApp = GetObject(class:="PowerPoint.Application")
    Err.Clear

    If PowerPointApp Is Nothing Then
    MsgBox "PowerPoint Presentation is not opened, aborting."
    Exit Sub
    End If

    If Err.Number = 429 Then
    MsgBox "PowerPoint could not be found, aborting."
    Exit Sub
    End If

    On Error GoTo 0

    PowerPointApp.ActiveWindow.Panes(3).Activate

    Set myPresentation = PowerPointApp.ActivePresentation

    mySlideArray = Array(3, 4, 5, 6, 7, 8)

    myRangeArray = Array(sh1.Range("A1:F14"), sh2.Range("A1:Q28"), sh3.Range("A1:P36"), sh4.Range("A1:AA26"), sh5.Range("A1:AA40"), sh6.Range("C1:AC28"))

    For x = LBound(mySlideArray) To UBound(mySlideArray)

    myRangeArray(x).Copy

    On Error Resume Next

    Set shp = PowerPoint.ActiveWindow.Selection.ShapeRange

    On Error GoTo 0

    With myPresentation.PageSetup

    .SlideHeight = 5.5 * 72
    .SlideWidth = 10 * 72
    .FirstSlideNumber = 3

    End With

    Next

    Application.CutCopyMode = False

    myPresentation.Save

    MsgBox "Report Completed"

    End Sub

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: excel to powerpoint automation

    see big yellow banner - upload your workbook - also place your code between code tags.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel data in powerpoint automation
    By Jixie31 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-20-2021, 09:41 AM
  2. Replies: 0
    Last Post: 08-23-2016, 09:43 AM
  3. Replies: 1
    Last Post: 06-09-2016, 12:05 PM
  4. Replies: 6
    Last Post: 08-18-2015, 06:39 AM
  5. Excel/PowerPoint VBA teaser: How to change data labels in PowerPoint chart by VBA?
    By lukelucky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-12-2015, 11:47 AM
  6. Excel Powerpoint Automation Run time Error
    By sjunak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2014, 04:03 AM
  7. Replies: 13
    Last Post: 01-11-2013, 04:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1