Do not share workbook

mnman

New Member
Joined
Dec 27, 2020
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

Thanks to MrExcel.com I got a new job doing Excel related work.
Unfortunately ☹️I never made a copy of my personal file from my old job.
I need code to prevent the sharing of my workbooks.
I believe I found it on MrExcel about 15 years ago.
It was simple 4 or 5 lines of code that prevented the sharing of the workbook. Something like Shareworkbook:Disable.

Thank you in advance.
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

Saurabhj

Active Member
Joined
Jun 6, 2020
Messages
390
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi mnman,

Check below VBA if this fulfil your requirement:

If ActiveWorkbook.MultiUserEditing Then
ActiveWorkbook.ExclusiveAccess
End If

ExclusiveAccess method assigns the current user exclusive access to the workbook that's open as a shared list.
MutliUserEditing is True if the workbook is open as a shared list.
 
Solution

Saurabhj

Active Member
Joined
Jun 6, 2020
Messages
390
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Thanks for replying. If resolved please mark the response as solution.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,294
Messages
5,595,282
Members
413,984
Latest member
stikpet

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top