Results 1 to 6 of 6

Excel misteriously crashes when populatins a comboboxes

Threaded View

  1. #1
    Registered User
    Join Date
    08-06-2012
    Location
    Buenos aires
    MS-Off Ver
    office 2010
    Posts
    3

    Excel misteriously crashes when populatins a comboboxes

    hi everybody!

    When I initialize a form in my excel I run this code to populate some comboboxes:

    Dim x As Integer
        
        CPIMenu.height = 545
        CPIMenu.width = 865
    
        CPIMenu.StartDate_Day.Clear
        For x = 1 To 31
            CPIMenu.StartDate_Day.AddItem x
        Next x
    
        CPIMenu.StartDate_Month.Clear
        For x = 1 To 12
            CPIMenu.StartDate_Month.AddItem x
        Next x
    
        CPIMenu.StartDate_Year.Clear
        For x = Year(Date) - 5 To Year(Date) + 15
            CPIMenu.StartDate_Year.AddItem x
        Next x
        
        CPIMenu.DesiredTripDuration.Clear
        For x = 1 To 90
            CPIMenu.DesiredTripDuration.AddItem x
        Next x

    HERE THE EXCEL CRASHES ABRUPTLY! IF I ERASE THE .CLEAR STATMENT, IT CRASHES WHEN TRYING TO LOAD THE FIRST ITEM. I HAVE INVESTED QUITE A LOT OF TIME TO UNDERSTAND WHAT IS HAPPENING BUT IS IT IS A MISTERY. IF I UNLOCK MY VBA CODE WITH MY PASSWORD, THEN IT NEVER CRASHES... IF I CLOSE THE WORKBOOK AFTER UNLOCKING THE VBA CODE AND THEN OPEN AGAIN THE EXCEL FILE AND RUN THE FORM, IT DOES NOT CRASH. IT ONLY CRASHES WHEN I OPEN A NEW INSTANCE OF EXCEL, OPEN THE FILE, AND OPEN THE FORM.

    CPIMenu.task1Day.Clear
        For x = 1 To 31
            CPIMenu.task1Day.AddItem x
        Next x
    DOES ANYONE KONW ABOUT ANY BUG THAT MAY BE CAUSING THIS AND HOW I CAN SOLVE THIS MISTERY?!

    THANKS IN ADVANCE FOR YOUR HELP!

    FRED
    Last edited by Cutter; 08-06-2012 at 07:57 PM. Reason: Added code tags

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