read vs write file

  • Thread starter Thread starter Alberto Ast
  • Start date Start date
A

Alberto Ast

If I open a file with macros... it could had been opened as read only or as
read/write....

Then how do I check with a macro if it was opened as read only or as
read/write?
 
bReadOnly = wb.ReadOnly

where wb refers to the workbook you want to know about

Regards,
Peter T
 
Will the statement read as follows?

if wb.ReadOnly then
wb.Close False
else
wb.Close True
end if
 
Yes..provided you have the wb object...

Dim wb as workbook
Set wb = ActiveWorkbook

If this post helps click Yes
 
Back
Top