I would not ask this if I could find any related posts about this.
What I have:
1.) A workbook with multiple sheets with data in it (each sheet has specific column "Managers")
What I need:
1.) Create multiple Workbooks from original Workbook which will contain data only for specific manager.
2.) Create set of permissions for each new file so only developers (me, for example) and specific manager can access the file.
What I've done so far:
1.) I managed to create new files with .SaveAs method
2.) Now I have to Call Create after each .SaveAs and this part doesn't work
Sub Create()
Dim ManagerPerm As Office.UserPermission
Set ManagerPerm = ActiveWorkbook.Permission.Add( _
"username@domain.loc", _
msoPermissionRead + msoPermissionEdit)
Set ManagerPerm = Nothing
End Sub
As it returns error on Set ManagerPerm = ...
I've never tryed this before, thanks in advance for any advice.
P.S. Yes, I know I have to remove all permissions before that but for now I can't even add new.
P.P.S. Workbook Permissions in VBA Macros
Who am I? How to use Microsoft Office Permission/UserPermission
didn't help me out in this matter