Excel hangs with userform

Joined
Apr 29, 2008
Messages
66
Reaction score
0
I have created a userform which contains about 20 textbox and combobox controls, all of which are linked to cells in one row of a worksheet via the ControlSource property. While developing this Excel hangs, either when working in the VBA editor or when running it. Worse, when going back to an earlier saved and backed up version which appeared to be OK, that version also hangs on opening - it seems that a "timebomb" has been created which is triggered on opening the file or later on when continuing to edit it. The VBA contains no code other than a 1 line Sub to Show the userform.
After the first occurrence I completely recreated the userform from scratch and the same happened again (after unsuccessfully trying rebooting to ensure that I was using a clean version of Excel). It seems to be after adding the ControlSource links that things go wrong. I am using offsets (eg "=offset(BookMark, 0,1)" where Bookmark is a one cell named range) for these and they work OK.
I'm using Excel 2003 SP2.
Has anyone experienced anything similar or can anyone suggest a possible cause and avoidance action?
 
Joined
Apr 29, 2008
Messages
66
Reaction score
0
After much trial and error I've found that the problem seems to be cells containing linefeed characters (i.e. where Alt + Enter has been pressed when editing the cell value). After removing all of these the workbook and userform are now behaving normally. UserForm controls display these with the paragraph character used in Word but don't allow you to enter them.

Having said that, it isn't straightforward to reproduce the problem with a test workbook. It doesn't happen immediately and it isn't predictable when it will happen, so there may be some other factor at work as well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top