is there a way for a macro to know if the workbook is open "read-only"?

  • Thread starter Thread starter Newbie JrSysAdmin
  • Start date Start date
N

Newbie JrSysAdmin

i'm writing a macro which needs some basic security functionality
(fwiw, updating a database) and i want to simply piggyback on the
built-in workbook security technology of the password upon open/ "read
only" access if you don't have the password. i want for my macro to
take an action if the instance is one with write access to the
workbook, and to not take action otherwise. (something like "if
readonly = false then write to database else msgbox "you don't have
write access to this application") i'm having trouble finding
documentation to this- i would appreciate any help in here.
 
Use the ReadOnly property of the Workbook. E.g.,

If ThisWorkbook.ReadOnly = True Then


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

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

Back
Top