Private Sub errorLog()
Dim path, file As String
Dim nFileNum As Short
Dim Filename As String
Dim dTaskID As Double
Try
If CInt(TextBox1.Text) > 0 Then
MsgBox("worked")
End If
Catch ex As Exception
Filename = "c:\errorlog.txt"
nFileNum = FreeFile()
FileOpen(nFileNum, Filename, OpenMode.Append)
PrintLine(nFileNum, ex.ToString)
FileClose(nFileNum)
path = "C:\WINDOWS\notepad.exe"
file = Filename
dTaskID = Shell(path & " " & file, AppWinStyle.NormalFocus)
End Try
End Sub