View Single Post
 
Old 11-06-2015, 02:39 AM
Officer_Bierschnitt Officer_Bierschnitt is offline Windows 7 64bit Office 2013
Advanced Beginner
 
Join Date: Oct 2015
Posts: 79
Officer_Bierschnitt is on a distinguished road
Default Un-share and re-share a workbook?

Hi,

I have to work in a number of workbooks which are shared, allowing multiple users to edit them.
That is problematic as it prohibits some things I have to do in them.
Right now, I'm developing a macro that will run on a number of Excel_files which may or may not be shared.
The macro is in my personal macro_workbook and will not be part of those files, so the only thing I have to make sure of is that the files are
- made exclusive at the outset so that my macro can make all the
necessary edits
- re-shared at the end.

After some trial-and-error, I have somehow contrived to find a code to un-share a workbook. It is
>> ActiveWorkbook.ExclusiveAccess <<
I just see, there is a property >> SharedWorkspace << - but, well, that is a property while the other one seems to be a method.
Can anyone give me a hint on how to re-share a workbook at the end of my program (but only if it was shared to begin with if that can be done)?
Thanks a lot!

Best regards,

DataNibbler
Reply With Quote