Consulting

Results 41 to 60 of 71

Thread: Copy each excel worksheets and paste in each indivual slides

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #13
    VBAX Regular
    Joined
    Mar 2016
    Posts
    47
    Location
    However, I do have one question. When the PowerPoint is being opened, is it possible to have it opened with the company's Theme Color? The company I'm working requires this for every PowerPoint. I believe you mentioned a freeware on a different forum (nattyware/pixie), but I can't download it at this moment since it's blocked at work. The location of the file (that includes the layout/office theme) is "H:\My Documents\PPT Automation". The name of the layout is called: "OC-E PPT template - September". The VBA script down below is what I have thus far:

      
    Sub Test()
    
    With ActivePresentation
        .Slides.AddSlide .Slides.Count + 1, .Designs(1).SlideMaster.CustomLayouts(GetLayoutIndexFromName("OC-E PPT template - September", .Designs(1)))
    End With
    End Sub
    
    Function GetLayoutIndexFromName(sLayoutName As String, oDes As Design) As Long
        Dim x As Long
        For x = 1 To oDes.SlideMaster.CustomLayouts.Count
            If oDes.SlideMaster.CustomLayouts(x).Name = sLayoutName Then
                GetLayoutIndexFromName = x
                Exit Function
            End If
        Next
    End Function
    As of right now, it's not working. It gives the error: "ActiveX component can't create object."

    Is it possible - in addition to the previous VBA script - to give the newly opened PPT the respected layout and Office Theme?

    Yours sincerely,

    Djani
    Last edited by Djani; 03-16-2016 at 02:39 AM. Reason: wrong script

Posting Permissions

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