+ Reply to Thread
Results 1 to 6 of 6

Thread: add-in - modify/update

  1. #1
    Registered User
    Join Date
    09-10-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    add-in - modify/update

    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.

  2. #2
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    MS Excel 2010
    Posts
    2,247

    Re: add-in - modify/update problem

    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.

  3. #3
    Valued Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    209

    Re: add-in - modify/update problem

    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

  4. #4
    Registered User
    Join Date
    09-10-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: add-in - modify/update

    Thanks Watadude, that works fine and is good that other users cannot overwrite my work. Thank you so much.

  5. #5
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: add-in - modify/update

    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)

  6. #6
    Valued Forum Contributor
    Join Date
    08-21-2008
    Location
    Hamilton, New Zealand
    MS-Off Ver
    Office 2007
    Posts
    209

    Re: add-in - modify/update

    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
    Dim 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
    add this to a standard module
    Sub ClearStatusBar()
        Application.StatusBar = False
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0