open files

  • Thread starter Thread starter Lee
  • Start date Start date
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.
..
 
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
 
Back
Top