macros on shared file, UserInterfaceOnly

wasntme

New Member
Joined
Feb 1, 2019
Messages
37
Hello all,

I have a tracker file opened with user form login and showing/hiding individual sheet for each user. This file needs to be shared. The original code is using .protect and .unprotect to execute macros and vba changes on one of the sheets, which does not run on the shared file. Getting "Run-time error 1004: Method protect of object failed". I got the hint to use UserInterfaceOnly to make it work on shared file, but can not make it work successfully or find a solution online. The file is protected on open and close. Any help how to fix this and where to apply UserInterfaceOnly is greatly appreciated.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Hi
welcome to forum

In a shared workbook you cannot (unless another knows different) Protect or unprotect worksheets or the workbook in your code. Also you will find the general view about shared workbooks is don't.

If you want to share data across your network with staff, consider creating template copies of the workbook for each user. These would then connect to a master workbook (database) where they can read / write to their data from their template copy.

Hope Helpful

Dave
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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
Back
Top