ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determine Workbook Mode (https://www.excelbanter.com/excel-programming/398179-determine-workbook-mode.html)

Mike H.

Determine Workbook Mode
 
The first line in this if-statement is incorrect. What would be the correct
syntax?

If ActiveWorkbook.Mode < xlReadOnly Then
ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly
End If


JW[_2_]

Determine Workbook Mode
 
If Not ActiveWorkbook.ReadOnly Then
ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly
End If

Mike H. wrote:
The first line in this if-statement is incorrect. What would be the correct
syntax?

If ActiveWorkbook.Mode < xlReadOnly Then
ActiveWorkbook.ChangeFileAccess Mode:=xlReadOnly
End If




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

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