Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21271

Common dialog error

$
0
0
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

Viewing all articles
Browse latest Browse all 21271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>