View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default Skipping 'reopen' file prompt box using VBA


Bhupinder,

This will reopen an open file without the warnings..
but note that any changes are discarded!

Application.DisplayAlerts = False
Workbooks.Open (sPath)
Application.DisplayAlerts = True


--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Bhupinder Rayat wrote :

Hi all,

I have a piece of code that opens another spreadsheet, imports some
data, saves a closes down that file. this file that has shared access
so it can be updated similtaneously over a network.

However, if I have this particular file open on my machine and I run
the above code, I get the prompt box stating,

"example.xls is already open. Reopening will cause any changes to be
discarded. Do you want to reopen example.xls?", Yes or No...!

Is there any way of answering yes to this prompt box within the code
so it does not appear?

Thanks in advance,

Bhupinder Rayat