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.
 

dmt32

Well-known Member
Joined
Jul 3, 2012
Messages
5,345
Office Version
2013
Platform
Windows
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:

Forum statistics

Threads
1,085,245
Messages
5,382,556
Members
401,791
Latest member
BJSinger7623

Some videos you may like

This Week's Hot Topics

Top