Hi guys,
I have an addin saved in a network drive and share among others.
Every time i want to update / add codes to the addin, i have to ask everyone to close all their excel before i can do so. is there a way round it?
Thanks.
Don't hold data in the addin, save it in some datastore, a database, the registry, an ini file or so on, have an update flag somewhere and reload it when changed.
I understand the issue you have.
Maybe add the following workbook event to run on open/install, so all other users use of add-in file is read-only.
Assuming they have the add-in installed to the original file, and did not create it as a copy on install.
So any changes you make can be saved, and will take effect on next excel startup by the other users.
Private Sub Workbook_Open() If Environ("Username") <> "abcxyz" Then ThisWorkbook.ChangeFileAccess xlReadOnly End Sub
Thanks Watadude, that works fine and is good that other users cannot overwrite my work. Thank you so much.
You can protect the VBA project to prevent access to the code
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
In VB Editor go Tools > VBA Project Properties > Protect Tab > Add a password (and lock for viewinhg as required).
However a handy tip is, dont forget the password.
A bit of code I use is -
This will display the password in the status bar for 2 seconds (to trusty users id's only) on opening
add this to the workbook open even with the read-only on open code
add this to a standard moduleDim UserID As String ' string of trusty user id's Const TrustyUsers = "abcxyz,xxyzzz" UserID = Environ("UserName") If InStr(TrustyUsers, UserID) > 0 Then Application.StatusBar = "User " & UserID & " the VBProject password is: ABC123" Application.OnTime Now + TimeSerial(0, 0, 2), "ClearStatusBar" End If
Sub ClearStatusBar() Application.StatusBar = False End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks