Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerpoint VBA - runs in debugger but not in slide show

Status
Not open for further replies.

snoopy6

Technical User
May 21, 2003
2
GB
Hi,

Newbie to forum so be gentle. I have written some code to paste a string into a textbox on a particular slide:

Sub ShowAnswers()
Dim AnsList As String
AnsList = "The answers are as follows:" & vbCrLf
For X = 0 To NOOFQS - 1
AnsList = AnsList & Qs(X) & ") Correct Answer:" & Choices(X, Ans(X + 1)) & vbCrLf
Next X
SlideShowWindows(1).Presentation.Slides("Answer list").Shapes("Text Box 2").TextFrame.TextRange.Text = AnsList

End Sub

When I am in Slideshow mode and run this macro nothing happens, when I am in debugging mode and F8 my way through the macro with the slideshow running it works. I'm sure I'm missing something fundamental here, any ideas why it will only work in the debugger
 
May be too simple, but is your security level set to allow macros to run?

Tools>Macros>Security

 
I think you need to call this macro when a particualr slide comes up or you can assign it to a button on the required slide to call this macro.

Hope this helps

Ram P
 
Thanks for the responses so far. The security settings are fine to allow the running of macros. However when I came in this morning and tried the macro again it worked fine.

This seems to suggest that yesterday "SlideShowWindows(1)." was not pointing to my presentation yesterday whereas now it is. Does this make sense to anyone and is there any way around it or to correct it?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top