VSTO & .NET & Excel

November 1, 2007

.NET Co Library – Part V

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

To read previously posts about the .NET Co Library please see the following entries:

Based on input from some testers I decided to implement a dedicated Windows form to only insert code into modules with. However, all other ideas and suggestions may only be considered to be implemented in future updates of .NET Co Library.

Insert code
In one of the previously blogpost (.NET Co Library – Part II) the main form for managing code (delete, update and insert code) was presented. Now I have added a new option to insert code in present code modules and also to add code to new added code modules (class and general modules).

The following image shows the new added options in the menus:

newmenu.png

Based on which main group that is selected the Windows form is populated with the related subgroups. The following image shows the form when “Insert Snippet Code” has been selected:

insert1.png

Since I have had (and still have) issues with making Windows forms modeless in the VB Editor I have solved it by setting its property TopMost to True (Actually, the problem is that Excel crash when closing it due to the modeless status). The drawback with this solution is that the Windows Forms always stay at the front even if Excel is not the active program.

It always seems to be a conflict between design of the UI and the wanted functions. In my experience there is also necessary to make a compromise in order to get a workable solution. In this context I have made it possible to expand each row so the whole code for an entry can be viewed by clicking on the row in the Code column. But in order to restore the row heights I was forced to add a button (Reset Row height) which reset all rows height. The following image shows expanded code rows:

insert2.png

Another “issue” to decide on was if only single entries or multiply entries can be selected. I decided to go with the later as the following image shows:

multiselection.png

The final aspect I considered was to how to solve if there is a larger group of entries how could we locate the wanted code in an easy way. I solved it by using a built-in Filter functions in the grid. It use the extra row below the fieldnames as the following image tries to show:

filter.png

Finally, the Export button export all code to a RTF file. At present I’m pleased with it but I may in an upcoming update make it possible to export selected code to a RTF file.

That’s it! I will now set focus to write the complete helpfile for this utility.

Kind regards,
Dennis

Advertisements

Leave a Comment »

No comments yet.

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

Create a free website or blog at WordPress.com.

%d bloggers like this: