VBA Code Library

Source: johnske, http://www.vbaexpress.com

It’s often a pain to search through workbooks to find a handy procedure you might want to use somewhere else. This Excel code library allows you to save all these handy snippets of code, userforms, and class modules in one location. you can then view the code or run it to see whether it suits what you want to do now. (Note that you can also save your Word, Outlook, etc. modules in here but you generally won’t be able to run them)….MOST of the examples in the attachment are my own code but there are a few that I have picked up from various places. Please note that I often lose track of where I get code samples from, so if you do recognize code that may perhaps be ‘yours’ and it has not been acknowledged therein as such, my sincerest apologies to you, but you do have the small consolation that it has been recognized as being a useful, neat, or otherwise handy piece of code worthy of inclusion in a ‘library’ by a wannabe coder :o) … The code for the library (below) caters for up to 200 procedures, I think if you have any more than that it will become hard to find a given procedure and it would be more advisable to make another library (a copy) to include any further code. NOTE THAT THE CODE BELOW IS FOR YOU TO CREATE YOUR OWN LIBRARY FROM SCRATCH. IT’S ADVISABLE TO JUST DOWNLOAD THE ATTACHMENT AND REMOVE ANY CODE YOU DON’T WANT.

For example workbook: CLICK HERE

Advertisements

2 Comments »

  1. muddanmadhu said

    I am getting error while selecting the component name.

    Error : runtime error 1004
    programmatic access to visual basic project is not trusted.

    • selvavpasupathy said

      Open the Office 2003 XP (Excel) application. On the Tools menu, click Macro, and then click Security to open the Macro Security dialog box. On the Trusted Sources tab, click to select the Trust access to Visual Basic Project check box to turn on access. Click OK to apply the setting. You may need to close the application completely (not only the files, but all the files along with excel application) & restart the application for the code to run properly if you automate from a Component Object Model (COM) add-in or template.

      I hope this helps…

      Selva V Pasupathy

RSS feed for comments on this post · TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: