View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
OssieMac OssieMac is offline
external usenet poster
 
Posts: 2,510
Default Exit Macro if<vbYes

Not sure if you will need this or if you already know it but just in case to
save you from further problems.

If you use Bob Phillips' method then use the following to open the file if
selected:-

Workbooks.Open Filename:=.SelectedItems(1)

If you use the method I gave you then it is as follows:-

Workbooks.Open Filename:=vrtSelectedItem

Regards,

OssieMac


"Bob Phillips" wrote:

With Application.FileDialog(msoFileDialogOpen)

.Show
If .SelectedItems.Count = 0 Then
Exit Sub
End If

End With


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Mike" wrote in message
...
I have this code and it works good. But how can i get it to exit the macro
if
< vbyes

Thanks Mike

Set FD = Application.FileDialog(msoFileDialogOpen)
With Application.FileDialog(msoFileDialogOpen)

If .Show Then .Execute

End With