read vs write file

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?
 
P

Peter T

bReadOnly = wb.ReadOnly

where wb refers to the workbook you want to know about

Regards,
Peter T
 
A

Alberto Ast

Will the statement read as follows?

if wb.ReadOnly then
wb.Close False
else
wb.Close True
end if
 
J

Jacob Skaria

Yes..provided you have the wb object...

Dim wb as workbook
Set wb = ActiveWorkbook

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top