ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open spreadsheet (https://www.excelbanter.com/excel-programming/367399-open-spreadsheet.html)

Grace79

Open spreadsheet
 

Any help much appreciated!

When a spreadsheet is opened using a button containing a macro from
another spreadsheet, why doesn't it alert the user if someone is
already in the file? It just opens a 'read-only' copy. Is there any way
around this, with code or anything?

Thank you!


--
Grace79
------------------------------------------------------------------------
Grace79's Profile: http://www.excelforum.com/member.php...o&userid=36435
View this thread: http://www.excelforum.com/showthread...hreadid=562024


Duncan[_5_]

Open spreadsheet
 

If ThisWorkbook.ReadOnly = True Then
MsgBox "Read only"
Else
MsgBox " Read-Write"
End If


or...

If ThisWorkbook.ReadOnly = True Then
ThisWorkbook.Close
Else
MsgBox " read write"
End If




Duncan



Grace79 wrote:

Any help much appreciated!

When a spreadsheet is opened using a button containing a macro from
another spreadsheet, why doesn't it alert the user if someone is
already in the file? It just opens a 'read-only' copy. Is there any way
around this, with code or anything?

Thank you!


--
Grace79
------------------------------------------------------------------------
Grace79's Profile: http://www.excelforum.com/member.php...o&userid=36435
View this thread: http://www.excelforum.com/showthread...hreadid=562024



Bob Phillips

Open spreadsheet
 
Check the readonly property of the workbook, and message it yourself

Workbooks.Open sFilename
If activeworkbook.ReadOnly Then
MsgBox "File already open, so it is readonly"
EndIf

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Grace79" wrote in
message ...

Any help much appreciated!

When a spreadsheet is opened using a button containing a macro from
another spreadsheet, why doesn't it alert the user if someone is
already in the file? It just opens a 'read-only' copy. Is there any way
around this, with code or anything?

Thank you!


--
Grace79
------------------------------------------------------------------------
Grace79's Profile:

http://www.excelforum.com/member.php...o&userid=36435
View this thread: http://www.excelforum.com/showthread...hreadid=562024





All times are GMT +1. The time now is 12:22 AM.

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