Gizzle72 0 Newbie Poster

I am trying to create a powerpoint quiz that tallies the scores, provides the results e.g. 95 out of 100 and the percentage %, then writes the users name and results to an excel spreadsheet. Oh, and all this has to be done using Office 2007 products. Can anyone help? So far I have:

Dim UserName As String
Dim numberCorrect As Integer
Dim numberWrong As Integer

Sub YourName()
UserName = InputBox(Prompt:="Type Your Name!")
MsgBox " Welcome to the Mortgage Servicing Assessment - Session 1 " + UserName, vbApplicationModal, " Mortgage Servicing Assessment"
End Sub

Sub Correct()
MsgBox " Well Done! That's the correct answer " + UserName, vbApplicationModal, " Mortgage Servicing Assessment"
numberCorrect = numberCorrect + 1
ActivePresentation.SlideShowWindow.View.Next
End Sub

Sub Wrong()
MsgBox "Sorry! That's the wrong answer " + UserName, vbApplicationModal, " Mortgage Servicing Assessment"
numberWrong = numberWrong + 2
ActivePresentation.SlideShowWindow.View.Next
End Sub

Sub Start()
numberCorrect = 0
numberWrong = 0
YourName
ActivePresentation.SlideShowWindow.View.Next
End Sub

Sub Results()
MsgBox ("You Got " & numberCorrect & " out of " & numberCorrect + numberWrong & ", " & UserName), vbApplicationModal, " Mortgage Servicing Assessment"
End Sub

Sub WriteStringToFile()
Dim strFileName As String
Dim IFNum As Integer
Dim strResult As String
Dim UserName As String
UserName = "YourName"
strResult = UserName & ",Results"
strFileName = "Test_Results.xls"
IFNum = FreeFile
Open strFileName For Append As IFNum
Print #IFNum, strResult
Close IFNum
End Sub

Sub closeit()
SlideShowWindows.View.Exit
Application.Quit
End Sub

It works up until the writestring and the closeit. Nothing happens. Happy to try any suggestions. If possible would love to have option to print certificate that shows username and result as well

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.