VBA form that disappears

%3CLINGO-SUB%20id%3D%22lingo-sub-2755100%22%20slang%3D%22en-US%22%3EVBA%20form%20that%20disappears%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2755100%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi.%3C%2FP%3E%3CP%3ESorry%20for%20my%20bad%20english.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20an%20excel%20file%20with%20macros%20that%20uses%20a%20form%20who%20contains%20a%20listbox.%20Well...%20the%20forms%20disappears%20when%20the%20program%20starts.%20It%20take%20some%20time%20to%20populate%20it%2C%20and%20at%20the%20end%20of%20the%20routine%2C%20the%20form%20disappears.%20I%20have%20to%20launch%20another%20application%20(a%20browser%20or%20Explorer%20or%20whatever)%20and%20then%20close%20it%2C%20and%20finally%20clicking%20on%20my%20excel%20file%2C%20the%20form%20appears%20correctly.%3C%2FP%3E%3CP%3EI%20do%20this%20steps%20on%20my%20VBA%20code%3A%3C%2FP%3E%3CP%3E_%20Set%20the%20form%3C%2FP%3E%3CP%3E_%20form.show%3C%2FP%3E%3CP%3E_%20in%20the%20%22userform_activate%22%20section%2C%20I%20populate%20the%20listbox%20from%20the%20cells%20of%20the%20current%20sheet%20(it%20takes%20some%20time...%20like%20half%20a%20minute)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat's%20it.%20At%20the%20end%20of%20the%20routine%2C%20the%20forms%20disappears.%3C%2FP%3E%3CP%3EHow%20can%20I%20manage%20to%20avoid%20the%20disappearing%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2755100%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2786425%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20form%20that%20disappears%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2786425%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1157450%22%20target%3D%22_blank%22%3E%40JJFox%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20-%20You%20could%20try%20just%20adding%20a%20button%20to%20the%20sheet%20and%20linking%20to%20the%20form.show%20macro.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

 

Hi.

Sorry for my bad english.

 

I have an excel file with macros that uses a form who contains a listbox. Well... the forms disappears when the program starts. It take some time to populate it, and at the end of the routine, the form disappears. I have to launch another application (a browser or Explorer or whatever) and then close it, and finally clicking on my excel file, the form appears correctly.

I do this steps on my VBA code:

_ Set the form

_ form.show

_ in the "userform_activate" section, I populate the listbox from the cells of the current sheet (it takes some time... like half a minute)

 

That's it. At the end of the routine, the forms disappears.

How can I manage to avoid the disappearing?

 

Thank you.

1 Reply

@JJFox 

 

Hi - You could try just adding a button to the sheet and linking to the form.show macro.