How to run VBA code in powerpoint if my slides are all autotransition

My powerpoint contains 5 slides. The first slide is just a coverpage with a textbox “Welcome to presentation”. It has audio speech. After the speech, it will auto transition to slide 2.
The slide 2 is a multiple choice question. It has a question with 4 choices. I use optionbutton (activex control) for the 4 choices. Only 1 selection can be made as there is only one correct answer among the the 4 choices. It will show you made the correct choice or not before it auto transit to slide 3.
The slide 3 is the same as slide 2 with a multiple question and auto transit after choice made.
The slide 4 is also the same as slide 2 and slide 3.
The slide 5, I want to display a text box with the total correct score out of 3.
I try to insert the code in slide 5 but it does not run. I think if the slides are manually click, the code will run.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>**Dim score1 As Integer
Dim score2 As Integer
Dim score3 As Integer
Dim ttlscore As Integer
score1 = 0
score2 = 0
score3 = 0
If ActivePresentation.Slides(2).Shapes("OptionButton1").OLEFormat.Object.Value = True Then
score1 = 1
End If
If ActivePresentation.Slides(3).Shapes("OptionButton4").OLEFormat.Object.Value = True Then
score2 = 1
End If
If ActivePresentation.Slides(4).Shapes("OptionButton4").OLEFormat.Object.Value = True Then
score3 = 1
End If
ttlscore = score1 + score2 + score3
ActivePresentation.Slides(5).Shapes("scoremsg").TextFrame.TextRange.Text = "The score is " & ttlscore & "."**
</code>
<code>**Dim score1 As Integer Dim score2 As Integer Dim score3 As Integer Dim ttlscore As Integer score1 = 0 score2 = 0 score3 = 0 If ActivePresentation.Slides(2).Shapes("OptionButton1").OLEFormat.Object.Value = True Then score1 = 1 End If If ActivePresentation.Slides(3).Shapes("OptionButton4").OLEFormat.Object.Value = True Then score2 = 1 End If If ActivePresentation.Slides(4).Shapes("OptionButton4").OLEFormat.Object.Value = True Then score3 = 1 End If ttlscore = score1 + score2 + score3 ActivePresentation.Slides(5).Shapes("scoremsg").TextFrame.TextRange.Text = "The score is " & ttlscore & "."** </code>
**Dim score1 As Integer
Dim score2 As Integer
Dim score3 As Integer
Dim ttlscore As Integer
score1 = 0
score2 = 0
score3 = 0
If ActivePresentation.Slides(2).Shapes("OptionButton1").OLEFormat.Object.Value = True Then
score1 = 1
End If
If ActivePresentation.Slides(3).Shapes("OptionButton4").OLEFormat.Object.Value = True Then
score2 = 1
End If
If ActivePresentation.Slides(4).Shapes("OptionButton4").OLEFormat.Object.Value = True Then
score3 = 1
End If
ttlscore = score1 + score2 + score3
ActivePresentation.Slides(5).Shapes("scoremsg").TextFrame.TextRange.Text = "The score is " & ttlscore & "."**

Question is how to make it run and display the text when my slideshow autotransit to slide 5? can here attached the powerpoint for best illustration? I have tried to insert into onslideshowpagechange but it does not seems to work as my slide will not auto transit.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật