VSTO & .NET & Excel

September 19, 2007

.NET Co Library – Part II

Filed under: .NET & Excel, COM Add-ins — Dennis M Wallentin @ 12:40 pm

The managed COM Add-in .NET Co Library is introduced in the following blogpost: .NET Co Library – Part I 

The Code Part 

In order to add VBA code to the library we simple select the wanted code in the code window and choose one of the following commands under the Code section:

code.png

In the next step the following Windows form will become available where we create an alias for the code and add a comment if wanted:

add-code-to-library.png

The Code Library is organized in four predefined (and fixed) main groups, Code Snippet, Procedure, Module and finally the SQL Query group. Under each main group we can create customized subgroups. Under each subgroup we can add code to the library where each piece of code is saved under a customized unique alias.

The following screenshot shows the main Windows form, i e the core of the Code Library:

code-library.png

As You can see we can easily select main group, subgroup and a specific alias to which the code is associated with. We can both update and delete entries but the key function is to select wanted code to be inserted in the code window. We can either select a single code to be copied to the Window’s clipboard or we can add several code pieces and then copy all code to the clipboard.

The more code we store the larger the Access database will be (2 GB is the limit how large an Access database can be). Therefore a search function is available to, in a convenient way, locate the wanted code. The present search function is based on two similar SQL expressions, LIKE and NOT LIKE, where both of them can be used with “%” and “_”.  The following screenshot shows the Windows form for the search function:

search-code.png

In the next blogpost on the subject I will cover the Connection part of the add-in. 

Kind regards,
Dennis

Advertisements

4 Comments »

  1. Looks excellent Dennis. I like the idea of 4 main groups then subgroups – and using combo buttons, I guess a tree view would be the other way to go.
    Just out of curiosity, have you used DataGridViwe or DataGrid on the search form?
    Cheers
    Ross

    Comment by Ross — October 15, 2007 @ 9:58 am

  2. Hi Ross,

    I’m not fond of tree views basically due to the space requirement to create user friendly UIs.

    As for the component in use I use Component One NET’s DBGrid.

    BTW, let me know if You’re interested to test the present version (it’s complete except for the helpfile).

    Kind regards,
    Dennis

    Comment by Dennis Wallentin — October 15, 2007 @ 2:29 pm

  3. Hi Dennis,
    Good point on Tree Views, I think they can become hard to work with when you start going deep in to file structures too.

    Yes I would very much like to test .Net Code library, drop me a mail if you like.
    Cheers
    Ross

    Comment by Ross — October 16, 2007 @ 11:04 am

  4. Hi Ross,

    Check Your inbox and thanks for Your kindness to test it.

    Kind regards,
    Dennis

    Comment by Dennis Wallentin — October 16, 2007 @ 11:35 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

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

Blog at WordPress.com.

%d bloggers like this: