简体   繁体   中英

How can I share macros in Excel 2010?

I have a lot of macros I want to share with others in my company, and I currently have them saved in an add-in which I have stored on our network drive. This gives me one place to add or edit code and is automatically distributed to all users with the add-in installed.

Problem is sometimes when I go to edit the add-in workbook to add a new macro, it won't let me save claiming it is read-only. The file is not marked as read-only and I am here early enough this morning that there is nobody else on the system. I know sometimes it says that if any user is currently using their Excel (presumably since they have the add-in installed so Excel is referencing the file), but if nobody is here, how can this be happening?

More importantly, what is the recommended way to share macros across an organization without running into a lock whenever you try to edit the workbook? I would think there's a better way to do this that will not result in waiting for everyone to sign in and then asking them all to quit Excel.

Any ideas on how I can share macros in a way that will be easily editable?

A simple way to do this is as follows:

  1. Edit the add-in stored on a private folder.
  2. Once done, copy to the network share
  3. And here comes the important bit!: right-click the file and set it to read-only

Next time you can simply replace the add-in, as long as you make sure you quickly set it to read-only again. Alternatively you can have code in the add-in that checks for updates, see: http://jkp-ads.com/articles/updateanaddin.asp Though the article is about an add-in located on a webserver, you can adjust this easily for an add-in on a network share.

You can always export your macros and do the work by hand (distribution, versions etc.). This means loads of work for you, but you have great control over it.

The other way would be a source control solution like github , which has great features and covers all of your needs, but is an external tool.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM