Monday, December 16, 2019

Excel: Item Lister

Introduction

If you do some VBA programming regularly, you’ll be acquainted with the Object browser, which neatly reveals you all objects, houses and solutions belonging to any item in Excel (or any other library you have referenced in your VBA project).

Even though this is a large software to look for info on just a few of properties I uncover it not really handy when you e.g. want to get all of an objects homes into your VBA code.

So due to the fact I like a challenge I decided to create my possess object browser, which is proven to you below.

What does it do?

This resource employs the tlbinf32.dll to fetch information from typelibraries. I grabbed some code from numerous destinations (amongst which Chip Pearson’s excellent web-site and some newsgroup messages like this a single) and made a userform with a treeview control (for the reason that this is the kind of handle that can present hierarchical facts so nicely).

The support files of tlbinf32.dll can be downloaded right here: tlbinf32.zip and the dll can be identified here (not positive if you can use the obtain at will without having any licensing troubles though).

After downloading the dll it demands to be registered with home windows:

Click Begin, operate and variety:

regsvr32 c:YourPathToThedlltlbinf32.dll

Simply click Ok. If prosperous, Home windows will convey to you it correctly registered the dll.

In its simple point out, you choose any object in Excel and begin the tool, which will demonstrate you the 1st amount set of objects, houses and approaches of that variety. Right here is what the UI looks like immediately after starting off the instrument while you have a chart title chosen:

https://jkp-ads.com/
&#13
Tool’s most important window, exhibiting associates of a ChartTitle item

And in this article is the exact window following expanding two of the object’s users:

https://jkp-ads.com/
&#13
Major window soon after double clicking “Border” and “Font” objects.

As you can see, it is truly straightforward to get a list of all objects and attributes of an object.

What’s even greater is that you can get them into Excel easily. Clicking the “Report” button yields a checklist of all objects in the present show. Below a portion of those is revealed:

https://jkp-ads.com/
&#13
Final result of clicking “Report”.

You can think about that now it is quick to copy this and paste it into the VBE to speedily develop code that sets a ton of houses.

Download

I have built this instrument available for obtain:

Objectlister.zip


No comments:

Post a Comment