Why does code kicks me out of excel and lets excel reboot?

  • When I click on the commandbutton (cmdArtToevoegen) the code does add the new articles to my sheet and shows me the form (added, in stead of MsgBox) correctly.

    But my listbox (lstboxArt) on the form (frmArtikels) is acting strange (shows only 3 or 4 entries) and reboots excel.

    What is wrong with my code?

    Thx in advance for any help.

    • Best Answer

    Hi AL,

    It is related to the way you are filling the listbox in the refresh sub, if you exclude the refresh from the form initialise the problem does not seem to occur.

    I am not sure how the .rowsource command works, change it to .additem or .list



  • Justin,

    Thank you for your answer. You were right. I used the .list command and excel did NOT restart after adding a product.

    So your answer solved the problem for me, thanks a lot.



Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!