Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-13-2011, 07:36 AM
Kevie192 Kevie192 is offline Powerpoint VBA: Help Needed Windows XP Powerpoint VBA: Help Needed Office 2010 32bit
Novice
Powerpoint VBA: Help Needed
 
Join Date: Dec 2011
Posts: 1
Kevie192 is on a distinguished road
Default Powerpoint VBA: Help Needed

Hi all,



I'm trying to write some code to update a scoreboard on a few slides of a presentation using VBA but I'm getting a bit stuck and wondered if anyone can see what I'm doing wrong?

This part works absolutely fine:

Code:
 
Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)

    If SSW.View.CurrentShowPosition = 8 Then
Dim Team1Scr As String
Dim Team2Scr As String
Team1Scr = InputBox("Enter Team 1 Score:", "Scores")
ActivePresentation.Slides(8).Shapes("Scr1").TextFrame.TextRange.Text = Team1Scr
Team2Scr = InputBox("Enter Team 2 Score:", "Scores")
ActivePresentation.Slides(8).Shapes("Scr2").TextFrame.TextRange.Text = Team2Scr
SendKeys ("{ENTER}")

End If
    
End Sub
But, I need events for more than one slide, so I've tried adding in an ElseIf and it now doesn't show the boxes on any of the slides:

Code:
Sub OnSlideShowPageChange(ByVal SSW As SlideShowWindow)
 
    If SSW.View.CurrentShowPosition = 8 Then
Dim Team1Scr As String
Dim Team2Scr As String
Team1Scr = InputBox("Enter Team 1 Score:", "Scores")
ActivePresentation.Slides(8).Shapes("Scr1").TextFrame.TextRange.Text = Team1Scr
Team2Scr = InputBox("Enter Team 2 Score:", "Scores")
ActivePresentation.Slides(8).Shapes("Scr2").TextFrame.TextRange.Text = Team2Scr
SendKeys ("{ENTER}")
 
ElseIf SSW.View.CurrentShowPosition = 16 Then
Dim Team1Scr As String
Dim Team2Scr As String
Team1Scr = InputBox("Enter Team 1 Score:", "Scores")
ActivePresentation.Slides(16).Shapes("Scr1").TextFrame.TextRange.Text = Team1Scr
Team2Scr = InputBox("Enter Team 2 Score:", "Scores")
ActivePresentation.Slides(16).Shapes("Scr2").TextFrame.TextRange.Text = Team2Scr
SendKeys ("{ENTER}")
    
End If
    
End Sub
Any ideas?

Many thanks,

Kevin
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Serious help needed. karlyak22 Outlook 0 11-13-2011 07:32 AM
Powerpoint VBA: Help Needed Frontpage help needed ytryity Misc 1 03-19-2011 09:07 AM
Needed help with MSI Package ahaseeb Outlook 0 01-17-2011 10:19 PM
Powerpoint VBA: Help Needed help needed!!! thunder14 Word 1 10-17-2009 02:57 PM
Powerpoint VBA: Help Needed Help needed :) thechief55 PowerPoint 1 04-28-2009 01:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:21 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft