Results 1 to 2 of 2

Excel to PPT - VBA no longer working with 2013

Threaded View

  1. #1
    Registered User
    Join Date
    04-15-2014
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 365
    Posts
    49

    Excel to PPT - VBA no longer working with 2013

    Hi,
    Hoping someone could help, I have an excel workbook with several tabs/worksheets. and I found some VBA that converted a range on each worksheet into a shape a pasted it into a separate slide in a new work book.

    This however no longer works since we have moved to Office 2013.

    When the debugging screen comes up it highlights this row in step 7 - PPSlide.Shapes.Paste.Select

    Sub WorkbooktoPowerPoint()
     
    'Step 1: Declare your variables
    Dim pp As Object
    Dim PPPres As Object
    Dim PPSlide As Object
    Dim xlwksht As Worksheet
    Dim MyRange As String
    Dim MyTitle As String
    ThisFile = Sheets("Front Page").Range("G7").Value
     
    'Step 2: Open PowerPoint, add a new presentation and make visible
    Set pp = CreateObject("PowerPoint.Application")
    Set PPPres = pp.Presentations.Add
    pp.Visible = True
     
    'Step 3: Set the ranges for your data and title
    MyRange = "A1:AZ40" '<<
     
    'Step 4: Start the loop through each worksheet
    For Each xlwksht In ActiveWorkbook.Worksheets
    xlwksht.Select
    Application.Wait (Now + TimeValue("0:00:1"))
     
    'Step 5: Copy the range as picture
    xlwksht.Range(MyRange).CopyPicture _
    Appearance:=xlScreen, Format:=xlPicture
     
    'Step 6: Count slides and add new blank slide as next available slide number
    '(the number 12 represents the enumeration for a Blank Slide)
    SlideCount = PPPres.Slides.Count
    Set PPSlide = PPPres.Slides.Add(SlideCount + 1, 12)
    PPSlide.Select
     
    'Step 7: Paste the picture and adjust its position
    PPSlide.Shapes.Paste.Select
    pp.ActiveWindow.Selection.ShapeRange.Align msoAlignCenters, True
    pp.ActiveWindow.Selection.ShapeRange.Top = 1
    pp.ActiveWindow.Selection.ShapeRange.Left = 1
    pp.ActiveWindow.Selection.ShapeRange.Width = 720
     
    'Step 8: Add the title to the slide then move to next worksheet
    Next xlwksht
       'Step 9: Save and close presentation
        With PPPres
        FileName = ThisWorkbook.Path & "\" & ThisFile & "_Scoreboard" & ".ppt"
                  .SaveAs FileName
    
            .Close
            'Application.Quit
        End With
    
    'Step 10: Memory Cleanup
    pp.Activate
    Set PPSlide = Nothing
    Set PPPres = Nothing
    Set pp = Nothing
    End Sub

    I hope someone can help.
    Thank you in advance.

    Brad
    Last edited by Jissenka; 05-15-2015 at 12:08 AM. Reason: Mark as Sloved

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Data Connection to authenticated website no longer works in Excel 2013
    By sasquashblue in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-26-2014, 06:25 PM
  2. website hyperlinks no longer working in Excel
    By robert harris in forum Excel General
    Replies: 2
    Last Post: 06-11-2013, 04:33 PM
  3. Excel features mysteriously no longer working
    By GordonPSmith in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-18-2011, 03:58 PM
  4. Routine no longer working in Excel Module?
    By meridian2000 in forum Excel Programming / VBA / Macros
    Replies: 37
    Last Post: 06-17-2009, 09:20 AM
  5. Help: Excel 4 macro suddenly no longer working
    By Keske Saram in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-03-2005, 10:05 PM

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