Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

read vs write file

0 views
Skip to first unread message

Alberto Ast

unread,
Nov 23, 2009, 5:54:01 PM11/23/09
to
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?

Peter T

unread,
Nov 23, 2009, 6:10:57 PM11/23/09
to
bReadOnly = wb.ReadOnly

where wb refers to the workbook you want to know about

Regards,
Peter T

"Alberto Ast" <Alber...@discussions.microsoft.com> wrote in message
news:309F56ED-42AC-4C94...@microsoft.com...

Alberto Ast

unread,
Nov 23, 2009, 6:57:01 PM11/23/09
to
Will the statement read as follows?

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

"Peter T" wrote:

> .
>

Jacob Skaria

unread,
Nov 23, 2009, 10:58:01 PM11/23/09
to
Yes..provided you have the wb object...

Dim wb as workbook
Set wb = ActiveWorkbook

If this post helps click Yes
---------------
Jacob Skaria

0 new messages