Consulting

Results 1 to 2 of 2

Thread: Import from Excel to PPT MasterSlide VBA works in SldShow, but NOT appear until exit

  1. #1
    VBAX Newbie
    Joined
    Jul 2020
    Posts
    2
    Location

    Import from Excel to PPT MasterSlide VBA works in SldShow, but NOT appear until exit

    As an educator, I use PPT for class. I want a list of names to drop down on any slide of a multi-slide PPT, so using MasterSlide(1)Layout(4). Slide space is limited and I have similar dropdowns on normal slides already using the
    same basic method which works in Slide Show Mode.

    The problem (or, PPT limitation) is this works, but NOT without exiting the Slideshow and re-starting. Most useful
    to my situation is to have the list appear while continuing in SlideShow. Code:

    Sub ImportNames()
    Dim xlsWB As Object
    Set xlsWB = CreateObject("Excel.Application").Workbooks.Open(ActivePresentation.Path & "\StretchW59JH381.xlsx")

    ActivePresentation.Designs(1).SlideMaster.Shapes("T_1").TextFrame.TextRange = xlsWB.Worksheets(1).Range("B3")

    Set xlsWB = Nothing
    End Sub

    Any solution or concrete answer would be much appreciated!

  2. #2
    VBAX Newbie
    Joined
    Jul 2020
    Posts
    2
    Location

    Solved!

    Quote Originally Posted by ned cox View Post
    As an educator, I use PPT for class. I want a list of names to drop down on any slide of a multi-slide PPT, so using MasterSlide(1)Layout(4). Slide space is limited and I have similar dropdowns on normal slides already using the
    same basic method which works in Slide Show Mode.

    The problem (or, PPT limitation) is this works, but NOT without exiting the Slideshow and re-starting. Most useful
    to my situation is to have the list appear while continuing in SlideShow. Code:

    Sub ImportNames()
    Dim xlsWB As Object
    Set xlsWB = CreateObject("Excel.Application").Workbooks.Open(ActivePresentation.Path & "\StretchW59JH381.xlsx")

    ActivePresentation.Designs(1).SlideMaster.Shapes("T_1").TextFrame.TextRange = xlsWB.Worksheets(1).Range("B3")

    Set xlsWB = Nothing
    End Sub

    Any solution or concrete answer would be much appreciated!
    I was about to write an angry reply and say, "Thanks a lot for the help!" As you can see no one posted anything here!
    However, that would NOT be entirely true. In fact, 2 posts north of here John Wilson posted a solution: "Not exactly scientific but it seems to work." This solution got me to thinking about my problem - it's somewhat similar. BINGO!

    The above code works on masterlayouts in Slideshow mode after adding the following at the tail end of the sub:

    ActivePresentation.Designs(1).SlideMaster.CustomLayouts(4).Shapes("T_1").Vi sible = True

    Thanks a million!

Posting Permissions

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