Disabling the "could not open" notification

A

alfredo

Sorry, I have looked extensively but could not find this on my own.

In VBA code:

1) Is there a way of disabling the notification that Excel was not able to
open a file?

And to try to kill two birds with one stone:

2) Is there similary a way of also disabling the window that tells you it is
(trying to / in the process of) opening a file

Thanks
Alfredo
 
A

Ardus Petus

1) Use On Error

on error resume next
set myWS = Workbooks.Open("MyFile.xls")
on error goto 0
if myWS is nothing then
msgbox "File not found"
exit sub
end if

2)
Didn't understand the question

HTH
 
A

alfredo

Thanks.

I will use that, and/or a combination with:

Application.DisplayAlerts = False
Application.DisplayAlerts = True

... which I only just discovered.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top