Excel 2019 - legacy sharing options in VBA

Xillo

New Member
Joined
Jan 30, 2020
Messages
1
Office Version
  1. 365
  2. 2019
  3. 2016
  4. 2013
  5. 2010
  6. 2007
Platform
  1. Windows
Hello

I would like to use Legacy Sharing functions, as I used in former Excel verssions.
Even in 2016 verssion everything was working perfectly:
Sheets protected without password, and workbook shared with password.
So thats the way I was working before:
Unsharing
VBA Code:
Application.DisplayAlerts = False
ActiveWorkbook.UnprotectSharing password
Aplication.DisplayAlerts = True
ActiveSheet.Unprotect

Sharing:
VBA Code:
Application.DisplayAlerts = False
ActiveSheetProtect
ActiveWorkbook.ProtectSharing Filename:=link_to_file, SharingPassword:=password
Aplication.DisplayAlerts = True

Now Microsoft disabled password sharing options, and old sharing features is available as shared (legacy) but without password protection.

So I tried to enable legacy sharing and move password protection to sheet:

Unprotect/unshare:
VBA Code:
If ThisWorkbook.MultiUserEditing = True Then
ThisWorkbook.ExclusiveAccess
End If
ActiveSheet.Unprotect Password:=password


Protect/share:
VBA Code:
ActiveSheet.Protect Password:=password
ActiveWorkbook.SaveAs , , , , , , xlShared

Workbook is shared on start, and every time I have error:
VBA Code:
vba methid ExclusiveAccess of _workbook failed

I can't find way to legacy share/unshare in VBA. I even tried to record macro with manual sharing and unsharing, but VBA don't record anything....

Is there any way to use this legacy sharing options with VBA in Excel 2019...?

The worst thing is, that I had password shared documents, and after update excel to 2019 anyone can remove sharing protection without password...

Best regards
Łukasz
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Watch MrExcel Video

Forum statistics

Threads
1,127,334
Messages
5,624,069
Members
416,010
Latest member
NJT

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