-
Private Sub mnuFileSaveAs_Click()
CommonDialog1.Filter = "Text (*.txt)|*.txt|" 'You can add other File Names here
CommonDialog1.ShowSave
Open CommonDialog1.Filename For Output As #1
Print #1, Text1.Text
Close #1
End Sub
I'm getting an error 75 path/file access error when I go to save the file, but then selected cancel button instead.
Can anyone help?
-
set the cancelerror property to true. then catch the error.
Code:
Private Sub mnuFileSaveAs_Click()
on local error goto errhandler
commondialog1.cancelerror = true
CommonDialog1.Filter = "Text (*.txt)|*.txt|" 'You can add other File Names here
CommonDialog1.ShowSave
Open CommonDialog1.Filename For Output As #1
Print #1, Text1.Text
Close #1
errhandler:
'catch cancel error here
End Sub
You can also set the cancelerror in design view