ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Adding code to control on form causes Excel to crash (https://www.excelbanter.com/excel-programming/340700-adding-code-control-form-causes-excel-crash.html)

skuzapo

Adding code to control on form causes Excel to crash
 

Good day folks,

I have a form which shows the user information which has been entere
previously and asks for new user input.

The form worked fine until I added some new controls and added the cod
to populate the combo boxes which a few choices.

I put a stop in the code and stepped through to see what the proble
was and it ran fine until it got to the new code. When it gets to th
first line of the new code excel crashes every time.

I have tried deleting the controls and starting again by adding them t
the form and I have tried using a new form - both cause excel t
crash....
Is there a memory limit that I'm reaching? The entire spreadsheet onl
weighs in at 1mb so surely not?

Any advice on how to solve this issue?

Thanks a lo

--
skuzap
-----------------------------------------------------------------------
skuzapo's Profile: http://www.excelforum.com/member.php...fo&userid=2743
View this thread: http://www.excelforum.com/showthread.php?threadid=46946


Michael Malinsky[_2_]

Adding code to control on form causes Excel to crash
 
It would be useful if you would post the code and point out the line on
which your code bombs.


skuzapo

Adding code to control on form causes Excel to crash
 

Hi Michael,

Thanks for your reply.

Regarding the code that causes the crash - it can be anything
Basically as soon as I add any type of new code to control any kind o
new control it bombs. I don't think the problem can be code related ca
it?

It seems to me that it's a memory issue or something

--
skuzap
-----------------------------------------------------------------------
skuzapo's Profile: http://www.excelforum.com/member.php...fo&userid=2743
View this thread: http://www.excelforum.com/showthread.php?threadid=46946


skuzapo

Adding code to control on form causes Excel to crash
 

Hi folks,

further to this problem, I've now tried the same code on my pc at hom
with no problems. I also used the code cleaner from Appspro which To
Ogilvy suggested. I still get the same problem on the form so I made
test version of my form (stripped down version in a new spreadsheet
and tried that with the same crash problem again.

The code that causes the crash is very simple. The crash occurs whe
the "With" line is reached:

Private Sub cmdTest_Click()

With frmCosting.cmbOHType
.RowSource = ""
.AddItem "Big"
.AddItem "Small"
End With



I'd appreciate any advice!
Thanks

frmCosting.Show

End Su

--
skuzap
-----------------------------------------------------------------------
skuzapo's Profile: http://www.excelforum.com/member.php...fo&userid=2743
View this thread: http://www.excelforum.com/showthread.php?threadid=46946



All times are GMT +1. The time now is 12:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com