+ Reply to Thread
Results 1 to 7 of 7

Update VBA code in multiple workbooks

  1. #1
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Update VBA code in multiple workbooks

    Making an Excel application with VBA for yourself to ease your workload is great.
    Making an Excel application with VBA for your office neighbor is even greater, you get good feedback and everyone is a winner!
    Making an Excel application with VBA for two office neighbors is also great but now you have two places to update and bugs must be fixed on both.

    still good success, the word spreads and your Excel/VBA capability is now a well known resource.

    Making an Excel application with VBA for the entire office works fine in the beginning but as the number of users increase, so do the number of bugs discovered and the number of updates needed...

    3 or 4 workbooks is still manageble but updating the VBA code and testing is now a real chore.

    Time to pull the emergency brake and tell people that we need at least a contractor to set up an Access Database for us! Of course the emergency brake is not connected to anything and no one is interested in listening, let alone spend money. "It works fine, just fix the bugs. And oh, by the way, here is another feature I want you to implement..."


    Does anyone recognize this situation? Is there a way to manage and update VBA code in multiple workbooks?
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Update VBA code in multiple workbooks

    Hi,

    I would suggest that you put all common code into an add-in rather than replicating it in individual workbooks. You can then either redistribute the add-in when changes are required, or store it in a central location so you only have to update that one file.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Update VBA code in multiple workbooks

    I figured that Add-in would come up. I kind of know what it is but I never used it. I have a bunch of buttons in the sheet and I also use Events (selection change) although.

    Can I still use buttons on the sheet or do I have to make some kind of banner setup? Would the Event thing work?

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Update VBA code in multiple workbooks

    Hi Jacc,

    I'm with you, never have converted my code to an Add-In. AND - I've written a lot of code...

    Searching for what xlinitwit thinks is easy I find one of my favorite sites at:

    http://www.cpearson.com/Excel/CreateAddIn.aspx

    good luck!! Let me know if it is easy and I may try it. I've done exactly what you describe above. When too many people are using your code and want more features, you turn into a programmer and stop doing your real work. My suggestion is to be happy and "don't burn out". Keep learning!!!
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Update VBA code in multiple workbooks

    An add-in is basically just a workbook with its IsAddin property set (by saving as an .xlam file).

    You can't use buttons on a sheet in the add-in since it's a hidden workbook. You may be able to use buttons in the workbook(s) to simply call code in the add-in, and the same for your events. Alternatively you can use application events in the add-in to trap events in any open workbook.

    Maintaining a centrally stored add-in takes a little initial setup but makes life much easier thereafter- http://www.excelguru.ca/content.php?...rk-Environment

    Alternatively, it is possible to update them using login scripts if you know a friendly network admin.

    Without any specific information as to what it is that the code does, I am not really in a position to say which one- if either- makes more sense.
    Last edited by xlnitwit; 05-04-2017 at 09:49 AM.

  6. #6
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Update VBA code in multiple workbooks

    The Excel application in case is a basic purchase-order-pdf-generator. Data is added to a list and a pdf is can be generated based on a data line and some details filled in later in another sheet. The list also serves as a log, conditional formatting is used to warn about parts not having arrived at the specified date etc. Buttons are used for many things, copy previous lines, generating pdf, timestamp etc.

    Argument for keep working on the current setup is that it is not a central database, it's just used in a project and when the project is finished that version of the Excel app is forgotten. A new project is a fresh start with the latest revision. So far it's working pretty well and I'm happy with the userinterface side of it.

    I guess what I'm really looking for now is a way to compare code in different workbooks and a way of updating that code in a smooth way.

  7. #7
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Update VBA code in multiple workbooks

    I would agree with xlnitwit, an .xlam file that can be stored centrally is the direction I've adopted. Update the one file with changes and load via xlstart. Using a specific ribbon menu to make things available is good too. Its worth getting to know this as does save time in the long run. Ill see have I a workbook with anything that may help see the benefits.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Macro to find and update information across multiple sheets and multiple workbooks
    By maxhecht2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2016, 11:35 AM
  2. Code to update links when the source workbooks are password protected
    By jobdillon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2014, 01:02 PM
  3. Update multiple workbooks
    By Benoot in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-29-2013, 05:01 PM
  4. Need vba code Real Time Update from 2 workbooks through so's get values of column
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-26-2013, 06:15 AM
  5. Multiple workbooks need to be connected and update together
    By GingerLeake in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-28-2013, 08:06 AM
  6. VBA code to update master file and reflect changes on other workbooks
    By Kimston in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2012, 08:56 AM
  7. Update VBA code in multiple workbooks
    By Little Deuce in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-14-2012, 10:27 AM

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.6.0 RC 1