Hi all
I get a error when I in the dlgcommon press cancel button
On Error GoTo MnuNamnD_click_exit
With dlgDemo
.CancelError = True
.InitDir = mstrLastDir
.Flags = cdlOFNHideReadOnly
.fileName = .FileTitle '""
.Filter = "TextFiles *.txt|*.txt"
.ShowOpen
StrFileToOpen = .fileName
namn = .FileTitle
End With
On Error GoTo MnuNamnD_click_error
IntDemoFileNbr = FreeFile
Open StrFileToOpen For Binary Access Read As #IntDemoFileNbr
StrBuffer = Input(LOF(IntDemoFileNbr), IntDemoFileNbr)
TxtTestFile.Text = StrBuffer
Close #IntDemoFileNbr
mstrLastDir = Left$(StrFileToOpen, InStrRev(StrFileToOpen, "\") - 1)
Label14.Visible = False
Label16.Visible = True
Label16.Caption = "Fil :" & " " & namn
Exit Sub
MnuNamnD_click_error:
MsgBox " Ett Fel inträffade"
MnuNamnD_click_exit:
TxtTestFile.Visible = False
LstData.Visible = True
AvbTxt.Visible = False
SparaTxt.Visible = False
and the error code is runtime code 32755
because I pressed the cancel button.
How to omitt this
BonZo
I get a error when I in the dlgcommon press cancel button
On Error GoTo MnuNamnD_click_exit
With dlgDemo
.CancelError = True
.InitDir = mstrLastDir
.Flags = cdlOFNHideReadOnly
.fileName = .FileTitle '""
.Filter = "TextFiles *.txt|*.txt"
.ShowOpen
StrFileToOpen = .fileName
namn = .FileTitle
End With
On Error GoTo MnuNamnD_click_error
IntDemoFileNbr = FreeFile
Open StrFileToOpen For Binary Access Read As #IntDemoFileNbr
StrBuffer = Input(LOF(IntDemoFileNbr), IntDemoFileNbr)
TxtTestFile.Text = StrBuffer
Close #IntDemoFileNbr
mstrLastDir = Left$(StrFileToOpen, InStrRev(StrFileToOpen, "\") - 1)
Label14.Visible = False
Label16.Visible = True
Label16.Caption = "Fil :" & " " & namn
Exit Sub
MnuNamnD_click_error:
MsgBox " Ett Fel inträffade"
MnuNamnD_click_exit:
TxtTestFile.Visible = False
LstData.Visible = True
AvbTxt.Visible = False
SparaTxt.Visible = False
and the error code is runtime code 32755
because I pressed the cancel button.
How to omitt this
BonZo