VB Code:
Option Explicit
Private Sub Command1_Click()
On Error GoTo No_Bugs
Dim sStr As String
CommonDialog1.CancelError = True
CommonDialog1.Filter = "Data Files (*.dat)|*.dat"
CommonDialog1.FilterIndex = 0
CommonDialog1.Flags = cdlOFNOverwritePrompt Or cdlOFNPathMustExist Or cdlOFNHideReadOnly
CommonDialog1.DefaultExt = "dat"
CommonDialog1.ShowSave
sStr = CommonDialog1.FileName
Open sStr For Output As #1
For a = 1 To 6
Print #1, lblAnswer(a).Caption
Next
For a = 1 To 12
Print #1, txtData(a).Text
Next
Close #1
Exit Sub
No_Bugs:
If Err.Number = 32755 Then
'Canceled
Else
MsgBox Err.Number & " - " & Err.Description, vbOKOnly + vbExclamation
End If
End Sub