I am working in VS2013 using the OpenFileDialog from a module and it works great once. If the user opens it again this error is displayed:
"ArgumentException was unhandled
An unhandled exception of type 'System.ArgumentException' occurred in System.Windows.Forms.dll
Additional information: Positive length is expected"
My code:
Dim fd As OpenFileDialog = New OpenFileDialog()
Try
With fd
.Title = "Select File Dialog"
.InitialDirectory = str_PathFileName
.FileName = Path.GetFileName(str_PathFileName)
.Filter = "All files (*.*)|*.*"
.Multiselect = False
.RestoreDirectory = True
If (.ShowDialog() = DialogResult.OK) Then
...
The error happens on the ShowDialog line. What am I missing?
str_PathFileNamewhen it crashes? There also might be more information in the Details of the exception dialog - Ňɏssa Pøngjǣrdenlarp