open files

L

Lee

In EXCEL macros, I open external files (e.g.,
Workbooks.Open Filename:=FullPath ...) for data. When I
try to open a file that has already opened, I got a
message like "xxx is already open. Reopening will cause
any changes you made to be discarded. Do you still want
to open ..."

The question is for some other files, I don't get this
message even they are already open. I don't like the
message to appear. thanks.
..
 
A

Anders S

Hi Lee,

If there have been any changes made to the workbook you are trying to re-open, the message will appear to prevent discarding the changes, just as the message says.
If no changes have been made to the workbook, the message will not appear.

Application.DisplayAlerts = False
Workbooks.Open Filename:=FullPath ...

will suppress the message and discard any changes made - if that's what you want.

HTH
Anders Silvén
 

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