Unusual VBA Not Responding Issue

bradyboyy88

Well-known Member
Joined
Feb 25, 2015
Messages
562
Hi,

I have a VBA program that has multiple modules and basically it starts a userform on workbook_open event. Then it goes to a log on screen in the userform. Once a userlogs in the code checks credentials against database to make sure its legit then it goes through a subroutine which basically sizes all the frames inside the userform. Sometimes the program will go not responding and crash at this point and I have narrowed it down to which part of the code does it:

Code:
        USERFORM1.BrowseFrame.Top = 30
        USERFORM1.BrowseFrame.Left = 120
        USERFORM1.BrowseFrame.Width = 822
        USERFORM1.BrowseFrame.Height = 462

Its strange because it will not always do this. To ensure it doesnt do it basically before i log in from the userform I will go to the VBE editor and close the userform then reopen it by running the workbook_open event. Its strange why that always ensures it doesnt do not responding and crash. I would also note that if by luck i open the excel workbook during a time that it wasnt going to not respond/crash and save it. Then re openining it in read only will automatically ensure it will not crash and will run as expected every time but only in read only since it was last saved in an okay state.

I cannot for the life of me figure this out.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
try before that DoEvents, give the code a short breathing space before trying something new
 
Upvote 0
try before that DoEvents, give the code a short breathing space before trying something new

So strangely enough, I use this same logic and resize and position a bunch of frame even after this point. If I comment out this frame getting done correctly the code never crashes. Its something about this frame in particular that makes me think its not a doevents type of error since that usually doesnt result in excel crashing completely. Is there anything in a frame or a frame itself that may cause a crash if these attributes are changed?
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,162
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top