Skipping 'reopen' file prompt box using VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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 :
 
keepITcool,

thanks for that, with a bit a tweeking, it works like a charm!!

Bhupinder //
 

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

Back
Top