Excel VBE Multiline Search And Replace

I’m a full time Excel developer.

That means I spend quite some time writing code in the Visual Basic Editor (VBE).
I don’t maintain a real code library, but I do copy lots of code from previous projects into new ones.

Whereas the VBE is quite a nice application to write code in, it does lack some functionality I needed a couple of weeks ago: the ability to do a search and replace operation on multiple lines of code in one go.

For example, many routines in my projects contain an error handling mechanism of some sort. These may look like this:

TidyUp:
    On Error GoTo 0
    Exit Sub
locErr:
    If ReportError(Err.Description, Err.Number, “DoFindReplace”, “Module modMain”)=vbRetry then
        Resume
    Else
        Resume Next
    End If

Now what if I want them to look like this:

TidyUp:
    On Error GoTo 0
    Exit Sub
locErr:
    Select Case ReportError(Err.Description, Err.Number, “DoFindReplace”, “Module modMain”)
    Case vbRetry
        Resume
    Case vbIgnore
        Resume Next
    Case vbAbort
        Resume TidyUp
    End Select

I wanted a tool that would let me replace the part after the IF statement with the part after the Select Case statement.
Well, here is my first go at it:

Excel VBE Multiline Search And Replace

And here is a screenshot:

Installing An Excel Add-in Using Setup Factory

Being an MVP has some benefits. One of them is that some software companies offer Not For Resale (NFR) products to them for free.
Of course these companies hope the MVP’s will advocate their products.

Well, for this one I will do so: Setup Factory.

I’ve started using this tool just a week ago and I must say I’m most impressed with it.

I published an article on my website today, which first discusses how Excel manages add-ins in the registry and then includes the needed scripts to include with Setup Factory to create and remove those registry entries.

Here is the article:

Installing An Excel Add-in Using Setup Factory

What is your favourite application to build setup files?

Regards,

Jan Karel Pieterse

Updating An add-in Through the Internet

Hi All!

I’ve just posted a new article to my website, with the subject as shown in the title of this post.

Short summary:

When you’re offering an add-in through your website it is sometimes useful if your users are automatically notified of updates (many software titles have such a mechanism built-in). The article shows a way to include that functionality with your add-in.

Read it here:

Updating An add-in Through the Internet

Enjoy!

Jan Karel Pieterse
JKP Application Development Services

New version of Autosafe (and free too!)

Announcing: Release of Autosafe 3.5

After about three months of testing I’ve released version 3.5 of my Excel Autosafe utility.
This new version has support for very long path and filenames.

More important: I decided to make Autosafe freeware entirely, no networking limitations or licensing fees.
The only thing I did include is a polite invitation to make a donation, which will pop up after it helped you to recover files a couple of times.

Description of the tool:

Autosafe automatically backs up your work in Excel. When you restart Excel after a crash, you’re offered to restore backed up copies of your files. You can also restore previous backup copies from your recycle bin to revert back to an older version of your work.

Enjoy!

Regards,

Jan Karel pieterse
wwww.jkp-ads.com

Obscure Excel VBA error: “Invalid Picture”

As many of the frequenters of this great place will know, Charles Williams and I created The Excel Name Manager. The # 1 (FREE) tool on the web to work with defined names in Excel.

Well, we do occasionally get feedback on this tool (which is always appreciated!) and in all these years, we got two reports stating the tool didn’t work at all, showing an “Invalid Picure” error which effectively prevented the tool from working.

So this appears to be a rather obscure error.

Colin Delane was kind enough to help me troubleshoot this problem (as he was the one experiencing it).

After some detective work, we nailed down the problem to one particular commandbutton on the NM’s main form. This button has a picture (as the others on the top have too):

Screenshot of Name Manager buttons. I circled the offending button. Note that this button only shows in the FastExcel version of NM.

The odd thing is, that it appeared to be the format of the picture that was causing havoc.

Both Meta and BMP are OK (no error on user’s system), but when we loaded a GIF picture format, the error occured reproducably.

Has anyone seen this before?

Regards,

Jan Karel Pieterse
www.jkp-ads.com

Working with Data Tables in Excel 2007

Hi all,

Today I published my first article dedicated to Excel 2007 on my site.

The article is about Excel 2007’s new Table feature and is aimed at the beginner Excel 2007 user (that would be just about everyone except John Walkenbach :-) ).

From the intro:

With the release of Excel 2007, Microsoft has introduced a new concept of working with tables of data. This new functionality is (not surprisingly) called “Tables”.
This article introduces you into the concepts of working with Tables and shows you how they may help you in your everyday Excel use.

Tables in Excel 2007 feature:

Integrated autofilter and sort functionality
Easy selecting
Header row remains visible whilst scrolling
Automatic expansion of table
Automatic reformatting
Automatic adjustment of charts and other objects source range

Read on here…

### Edited to correct the name of the feature ###

Enjoy!

Regards,

Jan Karel Pieterse
www.jkp-ads.com

Best wishes for 2007

Hi everyone,

Let me take this opportunity to wish everyone an Excellent 2007!

As in many parts of the world, a new year in Holland traditionally starts with expressing ones good intentions for the coming year (which -also traditionally- hardly ever last more than a week or two).

So what are your good intentions?