ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   stop excel file opened as read only if already opened by another u (https://www.excelbanter.com/excel-programming/336346-stop-excel-file-opened-read-only-if-already-opened-another-u.html)

bobm

stop excel file opened as read only if already opened by another u
 
hello,

how do i prevent an excel file being opened as read only if the file is
already opened by another user. this particular file is on the file server
and accessed by multiple users.

What I want is an alert if the file is already opened which says the file
cannot be opened as read only and click ok to close. the alert to inlcude the
username who has the file opened.

workbook sharing is not an option as it breaks my various vba macros

appreciate any help...

cheers

STEVE BELL

stop excel file opened as read only if already opened by another u
 
Play with this code (place it in your wb open code)

If ActiveWorkbook.ReadOnly Then ActiveWorkbook.Close FalseEnd If
--
steveB

Remove "AYN" from email to respond
"bobm" wrote in message
...
hello,

how do i prevent an excel file being opened as read only if the file is
already opened by another user. this particular file is on the file server
and accessed by multiple users.

What I want is an alert if the file is already opened which says the file
cannot be opened as read only and click ok to close. the alert to inlcude
the
username who has the file opened.

workbook sharing is not an option as it breaks my various vba macros

appreciate any help...

cheers




bobm

stop excel file opened as read only if already opened by anoth
 
thanks ...that works

STEVE BELL

stop excel file opened as read only if already opened by anoth
 
You're very Welcome!

Keep on Exceling....

--
steveB

Remove "AYN" from email to respond
"bobm" wrote in message
...
thanks ...that works





All times are GMT +1. The time now is 06:54 AM.

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