ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   end Macro after cancelling open dialog (https://www.excelbanter.com/excel-programming/302762-end-macro-after-cancelling-open-dialog.html)

No Name

end Macro after cancelling open dialog
 
I'm using this macro.

Dim vFilename
vFilename = Application.Dialogs(xlDialogOpen).Show
If vFilename < False Then
On Error Resume Next
End If

And the macro works good when you select a file.
You can chose also Cancel in the open box, and if you do
the macro runs instead of ending.

How c

Thx
Tom


papou[_9_]

end Macro after cancelling open dialog
 
Hi
Dim vFilename
vFilename = Application.Dialogs(xlDialogOpen).Show
If vFilename = False Then Exit Sub
'do your other stuff

HTH
Cordially
Pascal


a écrit dans le message de
...
I'm using this macro.

Dim vFilename
vFilename = Application.Dialogs(xlDialogOpen).Show
If vFilename < False Then
On Error Resume Next
End If

And the macro works good when you select a file.
You can chose also Cancel in the open box, and if you do
the macro runs instead of ending.

How c

Thx
Tom





All times are GMT +1. The time now is 09:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com