Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error in VBA332.DLL. Excel will now close. 1

Status
Not open for further replies.

Kaulana

Technical User
Jul 31, 2001
24
0
0
US
At odd intervals I will get an error in my Excel VBA that tells me: "Excel has caused an error in VBA332.DLL. Excel will now close. If you continue to experience problems, try restarting your computer."

Sometimes restarting will help. Other times not. Sometimes, I go through all the coding, leaving out all but certain bits till one of the bits left in causes the error. Then I know where to look for a problem. Sometimes rewriting the part solves the problems, sometimes not. Once, just the act of blanking out the bits and bringing them back solved the problem. That time, the error was happening when I brought in a form. Mostly and almost always the error happens when I use a keyboard shortcut to save the file or to print it. The VBA code to save the file upon closing the form does not give the error and it does save the changes in the VBA.

I've defragmented many times, and sometimes that solves the problem, but there is no way of telling when it will crop up again.

Can anyone please tell me why this error happens? Kaulana (aka Bob)
 
sounds to me like a corrupted spreadsheet, try re building the spreadsheet , start with a totally new book and copy over modules, worksheets from the original bit by bit.

also could be that you are not emptying out your objects, for example

Dim tobig as workbook

set tobig = openworkbook("blah blah")

at the end of you code running you should put

set tobig = nothing

also go through and clean up your code, find out what you can declare as public etc

also check you error handling as well for anythign rogue in there

Chance

 
Apparently that was the problem(s). Mostly a corrupt spreadsheet, I think, because when I coped it, the problem went with it. But when I copied the modules and forms (after triple-checking the code) onto a new spreadsheet, the errors and closings disappeared. Thanks for the direction.

Bob
Kaulana (aka Bob)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top