+ Reply to Thread
Results 1 to 7 of 7

crash on userform

  1. #1
    Registered User
    Join Date
    12-21-2010
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    crash on userform

    Hi, A year ago I created an excel file with vba in Office 2007. There were several userforms in it. All worked fine and the code gave no problem. Some weeks ago I installed Office 2010 and a lot of other excel files are working still fine with Office 2010. But this particular excel file is making excel crash when I use a certain Userform. Well ok I thought, maybe the file got corrupt. So I made a new file and copied all code in that one. But also here crashes when using a userform. Well ok I thought than I will build a new one from scratch which I am now doing. But also here crashes allthough I am only using userform savebutton with simple code to transfer the data from the userform into a database on a worksheet and then unload the userform. I get annoyed by this and start believing that it is an Office 2010 problem ..... Are there similar experiences?

    Userform save code

    Please Login or Register  to view this content.
    Last edited by Binder; 12-27-2010 at 10:29 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: crash on userform

    Hello Binder,

    Welcome to the Forum!

    The only suspicious piece in the code I can see is...
    Please Login or Register  to view this content.

    It would help to know the error number, error description, and line where the error is occurring. The first thing you should do is add Option Explicit to the top of module where the macro is. This will tell you if something is not defined before the code is executed and causes a possible crash. Without more information about the error, it is difficult to give a specific answer.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    12-21-2010
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: crash on userform

    I like to create class objects in my code. CPRODUCT is a self created class object.
    I changed Set myProduct1 = New CPRODUCT to
    Please Login or Register  to view this content.
    But also here again ...crash....


    And today I am creating a new userform and with the addition of a new textbox the userform is only crashing the complete Office 2010 application. So I build in the Save_Click button code an
    Please Login or Register  to view this content.
    which refers to the end
    Please Login or Register  to view this content.
    But the crash is so "complete" that even the error escape is not working.

    Since I have been using the Excel 2007 VBA book of John Green of Wrox I only do codes with Option Explicit on it. New in Office 2010 is that there is a optionbox in the Options of the VBE- window to start always with Option Explicit.

    I am using comboboxes... might those be the problem?
    Well I completely deleted the combobox from the userform and its code from the module.
    But this seems not to be the problem because... also crash.

    After a few crashes.
    I am using userform 1 in my workbook ...crash
    After starting excel again... I am using userform 2 in the same workbook.... no crash.
    Then I use userform 1 again in this workbook ....no crash..

    It is complete irrational the behaviour of the crash. Every time I click a save-button on
    one of the userforms... .... does it crash or not....
    Last edited by Binder; 12-28-2010 at 09:08 AM.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: crash on userform

    New in Office 2010 is that there is a optionbox in the Options of the VBE- window to start always with Option Explicit.
    That's not new in 2010 - it's been around for ages.


    Can you post a sample workbook with your problem form?
    Remember what the dormouse said
    Feed your head

  5. #5
    Registered User
    Join Date
    12-21-2010
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: crash on userform

    Hi, I created a sample of my workbook with which the crash always occurs.
    Maybe someone can have a look at it and try the daily current cost userform. This gives almost always a crash.
    I am using Windows7 and Office 2010.
    Attached Files Attached Files

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: crash on userform

    Can you define 'Crashes'.

    I can get an error by not completing the form correctly.
    Also the following returns an error because the control is hidden and a value not set.

    Please Login or Register  to view this content.
    What exactly do we need to do, other than double click to launch userform, in order to generate the crash?
    Cheers
    Andy
    www.andypope.info

  7. #7
    Registered User
    Join Date
    12-21-2010
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: crash on userform

    crashes.... means that the complete excel application shuts down.... I get a window saying Excel doesn't work anymore ...and is looking for a solution.... Followed by a window... Microsoft Excel is not working anymore. There is a problem which causes the program error. The program will be closed and a notice will be made if a solution is found. That is it.. I just did it again with the file I show here in the chat. The first data input in the daily current costs was accepted but the second time...crash.


    The crash happens after entering a couple of times data in the userform for the daily current costs. Try different categories. Maybe you are right that it might have to do with the
    Please Login or Register  to view this content.
    because when I have bought a book I enter category. "leesgerei" and don't get a subcategory. So myProduct1.SubCategorie can't read any value form the listbox ListBSubCategorie1. I will study on this more....

    I just changed the code of the save button for the userform of the daily costs so that the listbox for the subcategory always shows up after entering a value in the category listbox and gives a value so that the class myProduct1.SubCategrie always can read a value.... I tried then different data entries but...again....
    a crash.......
    Last edited by Binder; 12-30-2010 at 11:08 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1