ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Skipping 'reopen' file prompt box using VBA (https://www.excelbanter.com/excel-programming/324745-skipping-reopen-file-prompt-box-using-vba.html)

Bhupinder Rayat

Skipping 'reopen' file prompt box using VBA
 
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



keepITcool

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


Bhupinder Rayat

Skipping 'reopen' file prompt box using VBA
 
keepITcool,

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

Bhupinder //

"keepITcool" wrote:


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




All times are GMT +1. The time now is 07:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com