[RESOLVED] ending a very small program when its finished processing
Hi all,
I read up about this somewhere I have a very tiny basic program using the commondialog control. It is bieng called from a shortcut. How can I make it so it automatically closes when its finished. i.e. so the form closes when finished rather than the user having to close it.
VB Code:
Private Sub Form_Load()
Dim strFile As String
On Error Resume Next
With CommonDialog1
.Flags = cdlOFNExplorer
.Filter = "Jpg (*.jpg)|*.jpg"
.InitDir = "C:\"
.DialogTitle = "Select File"
.ShowOpen
If Not .FileName = "" Then
strFile = Mid(.FileName, InStrRev(.FileName, "\") + 1)
If Dir(FAVORITES_FOLDER & strFile) = "" Then
FileCopy .FileName, FAVORITES_FOLDER & strFile
End If
End If
End With
End Sub
thanks in advance
Rob
Re: ending a very small program when its finished processing
VB Code:
End If
End If
End With
Unload Me
End Sub
Re: ending a very small program when its finished processing
thanks very much indeed. Well appreciated :wave:
Re: ending a very small program when its finished processing
Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer. Also if someone has been particularly helpful, or even particularly unhelpful, you have the ability to affect a their forum "reputation" by rating their post.