PDA

View Full Version : Crash after add-in install



JWhite
08-07-2008, 07:26 AM
I posted a problem 2 months ago (http://vbaexpress.com/forum/showthread.php?t=20298) about a problem installing an Excel add-in. At that time I had made the add-in "self-installing" based on a great article on this Web site but occasionally it blew up during the install.

No one had an answer to the problem but I solved it by putting the install code in a separate workbook and the installation has worked maybe 100 times without a problem since then on 6 different computers. I haven't changed the code in the "install" workbook in weeks but I have continued to develop the add-in. Now I'm having crashes during the install again.

The add-in now has maybe 2,500 lines of code, 6 forms, 5 modules, and one class module. The add-in workbook is less than 200k in size. It's not doing anything unusual. This is my first big VBA project and I'm just using plain vanilla VBE for development. FYI, the main purpose of the add-in is to load data from an Oracle database into pivottables and it's working perfectly.

To install new versions, I zip the add-in and the Install workbook and send it to the users. When they open the Install workbook, it uninstalls the existing add-in, deletes the file, copies the new version into the add-in directory, and installs it. This code functions perfectly, too. The add-in installs and runs fine. But when I exit Excel for the first time after the install, I get "Out of memory" followed by "Catastrophic error".

The event viewer shows "Faulting application EXCEL.EXE, version 12.0.6300.5000, time stamp 0x47607042, faulting module VBE6.DLL, version 6.5.10.24, time stamp 0x464105f1, exception code 0xc0000005, fault offset 0x0004eae2, process id 0x113c". After Excel closes, I can re-open it and work with the add-in with no problems and it doesn't crash again until the next install.

After a lot of Googling, I found APPSPRO's VBA Cleaner software which copies everything off my add-in and builds a new one with the same code so you can get a fresh compile. This worked! I re-installed with no errors. However, after a few more changes to my add-in the next re-install crashed. I ran VBA Cleaner again and it worked again! But I don't feel I can keep on this way. I will be converting to an Installshield install in a month or so but I can't be sure this will solve the problem.

So has anyone else seen this behavior? Have I reached some size limit? I've google'd the error every way I can think of and I find that LOTS of people get catastrophic errors for all kinds of reasons. But I can't find anyone with a problem similar to mine. Thanks in advance!

Dr.K
08-07-2008, 09:09 AM
Yep, I've had this issue too. Using the article from this site, I have developed and deployed three different Excel Add-Ins. The install/uninstall/update routines run flawlessly on my PC, but for maybe 5-10% of users it crashes during install.

Usually it crashes when the code sets the Add-In Installed property to True. If that is the case, the solution is to call the user, have them open their Add-Ins menu manually, and then click on the checkbox next to the Add-In they were trying to install.

I've come up with a few work arounds, but they are total kludges, and I've never been able to replicate some of the wierd behavior. For example, on some machines, the '.Installed = True' part will fail if there isn't an active workbook open. So, as a workaround, I open a blank workbook during the install routine, and then close it. Since I can't explain it and/or reproduce it, its a crappy vodoo fix, but it seems to help.

Ya get what you pay for. I suppose I should be using an installer pack tool of some kind, but I'm sure that the development department would never let me do that.


EDIT: This guy seems to agree with me about the blank workbook.
http://vbadud.blogspot.com/2007/06/excel-vba-install-excel-add-in-xla-or.html

JWhite
08-07-2008, 10:13 AM
Thank goodness I'm not the only one! Thanks for letting me know I have company. As a matter of fact, I just had a user call me this morning with the "Unable to get the Add property of the Addins ... " problem and, as you said, I was able to walk him through the manual uncheck/check to install it.

But that's not the problem I've been having most of the time. I just tried your suggestion of opening a blank workbook before starting and still had the same problem. Everything installed fine and worked fine until I exited Excel and then I got the "Out of Memory" and "Catastrophic Error" stuff. When I re-opened Excel, the add-in was still installed and working fine. As I said, I can take that same add-in and run it through VBA Cleaner and it will install with no problem.

But it is SUCH a relief to find that others are having problems. Thanks for that!