michaelja22
01-30-2014, 02:32 AM
Hi, I'm working on building a small quiz in Powerpoint 2007, using some code I found online (this is my first post so the site won't let me share links :think:).
I'm trying to adapt it so that there are more questions, and more possible answers (16 questions, 4 answer choices), but it still re-uses the same slide for each question.
This quiz is to go at the end of a training presentation, so slide numbers are much higher than just 1, 2 & 3.
The problem I'm having is that the code simply doesn't work properly, whenever I try to run it I get the errors "Subscript is out of range" or "1 is not in the valid range of 1 to 0" and the debugger highlights this line:
SlideShowWindows(1).Presentation.Slides("QSlide").Shapes("Question").TextFrame.TextRange.Text = Qs(QNo - 1)
Can anybody explain to me what's wrong here? I've never used VBA before and thought it should be a simple case of changing a few values to increase the number of questions etc and redesign the slides. I'm happy to share the code or upload the file if that would help.
Thanks in advance for any help offered.
:banghead:
I'm trying to adapt it so that there are more questions, and more possible answers (16 questions, 4 answer choices), but it still re-uses the same slide for each question.
This quiz is to go at the end of a training presentation, so slide numbers are much higher than just 1, 2 & 3.
The problem I'm having is that the code simply doesn't work properly, whenever I try to run it I get the errors "Subscript is out of range" or "1 is not in the valid range of 1 to 0" and the debugger highlights this line:
SlideShowWindows(1).Presentation.Slides("QSlide").Shapes("Question").TextFrame.TextRange.Text = Qs(QNo - 1)
Can anybody explain to me what's wrong here? I've never used VBA before and thought it should be a simple case of changing a few values to increase the number of questions etc and redesign the slides. I'm happy to share the code or upload the file if that would help.
Thanks in advance for any help offered.
:banghead: