VBA and SharePoint permissions



I have an excel workbook running macros on an in-house SharePoint site. Files
are CheckedOut, Edited and CheckedIn with a Macro if the user is allowed to
Edit data through their SharePoint permission settings. Other users are not
allowed to Edit data but they are allowed to View/Read-only the Workbook
data. For user convenience, I would like the same Macro to auto start
whenever a user Opens the Workbook (this I can do). However since different
users have different permissions under SharePoint (Edit data vs. View/Read
only) I would like to read the individual user’s SharePoint permission
setting within the macro code and then use this to determine flow within the
macro (Editors can run the entire macro and Modify/Save the data and Viewers
default to the current read-only Workbook). Can this be done – if so how. If
not can you suggest another way to do this. Only one user can CheckOut the
workbook for editing at a time but multiple users can Open the workbook for
viewing (at the same time). If a View/Read-only user tries to CheckOut a
Workbook it will generate an error but this will also happen if a user whose
permission setting allows them to Edit a Workbook tries to CheckOut a
Workbook that is already checked out by another user. At least that's my
understanding and I'm sticking to it unless you tell me otherwise.
Thank you for your time and expertise in advance

Barb Reinhardt

What version of Excel are you using? I'm still working through some
sharepoint related issues, but you can use




I'm running into issues where I checkout a doc programmatically and then
discard the check out with

myWB.Checkin (False)

and it still keeps a version in my sharepoint drafts, so when I open the doc
again, it's got a version in the drafts already.

Barb Reinhardt


Came across this "ActiveWorkbook.SharedWorkbookFile.Delete" if you haven't
already tried it.

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