PDA

View Full Version : Horrible Listview problem...



Cybert99
07-04-2008, 12:35 AM
I'm working on a small VBA app (Excel 2002) that includes a userform with a Listview control. I've NEVER had trouble with Excel before but for some unfathomable reason I keep getting crashes.

It's not my program that crashes... it's Excel. Unrecoverable errors. Then it shuts down and tries to reload.

I think I've isolated the problem to ListView_Columnclick(). Whenever code execution stops there I run into this problem. Doesn't matter if it's a syntax error, a Stop command, or a breakpoint. When I pull down the run menu and hit Reset, Excel bombs out on me. Every single time.

I took out all my other code, removed all the other controls on the form. It still crashed. (The only VBA code I had left was "UserForm1.show" and a few lines to set up my ListView headers.)

When I did the same thing with a New form it did NOT crash. So I started all over again and made a new form from scratch and copied all my code over. Everything was fine for awhile, but now it's crashing again.

Any suggestions? Excel has always been rock solid for me, so this is driving me nuts.

Oorang
07-07-2008, 11:17 AM
Sounds like it's on it's way towards corruption. I would export the form, modules, & class modules and import them into a new blank excel file and see if that fixes your issue.

Cybert99
07-13-2008, 09:14 PM
I tried exporting all my code and forms, and that seemed to work at first. But then the problems came back.

The problem seems to be related to having an error (or some kind of stop) in the middle of a sort. Excel crashes out when this occurs, but otherwise the program seems to be okay. So I'm just working around the problem.