Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
In my excel, i have two userforms. I have used code like this.. Problem is when i unload userform1 and load userform2, the userform2 is not visible until i click excel file. I dont need to click excel file to activate userform2, how can i do this automatically. Userform1.show Do...... something.... Unload Userform1 Userform2.show do.. somethinng unload userform2 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
fi.or.jp.de pretended :
Hi All, In my excel, i have two userforms. I have used code like this.. Problem is when i unload userform1 and load userform2, the userform2 is not visible until i click excel file. I dont need to click excel file to activate userform2, how can i do this automatically. Userform1.show Do...... something.... Unload Userform1 Userform2.show do.. somethinng unload userform2 In order to have your code continue to run while your userforms are open you need to specify... Userform1.Show vbModeless 'Do stuff while userform is open Unload Userform1 I assume your users do not do anything with the userform other than watch what your code does. What stops users from closing it themselves? What are you doing in your code while the userform is displayed? How does the userform update while code is running? -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First userform1 gives option to input username and password
once it logs into the system automatically close the userform1 and userform2 loads - shows the progress of the macro or the work done. Once the userform1 unloads userform2 is not visible , I need to click on excel...... On Jan 11, 5:46*am, GS wrote: fi.or.jp.de pretended : Hi All, In my excel, i have two userforms. I have used code like this.. Problem is when i unload userform1 and load userform2, the userform2 is not visible until i click excel file. I dont need to click excel file to activate userform2, how can i do this automatically. Userform1.show Do...... something.... Unload Userform1 Userform2.show do.. somethinng unload userform2 In order to have your code continue to run while your userforms are open you need to specify... * Userform1.Show vbModeless * 'Do stuff while userform is open * Unload Userform1 I assume your users do not do anything with the userform other than watch what your code does. What stops users from closing it themselves? What are you doing in your code while the userform is displayed? How does the userform update while code is running? -- Garry Free usenet access athttp://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text - - Show quoted text - |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
fi.or.jp.de brought next idea :
First userform1 gives option to input username and password once it logs into the system automatically close the userform1 and userform2 loads - shows the progress of the macro or the work done. Once the userform1 unloads userform2 is not visible , I need to click on excel...... On Jan 11, 5:46*am, GS wrote: fi.or.jp.de pretended : Hi All, In my excel, i have two userforms. I have used code like this.. Problem is when i unload userform1 and load userform2, the userform2 is not visible until i click excel file. I dont need to click excel file to activate userform2, how can i do this automatically. Userform1.show Do...... something.... Unload Userform1 Userform2.show do.. somethinng unload userform2 In order to have your code continue to run while your userforms are open you need to specify... * Userform1.Show vbModeless * 'Do stuff while userform is open * Unload Userform1 I assume your users do not do anything with the userform other than watch what your code does. What stops users from closing it themselves? What are you doing in your code while the userform is displayed? How does the userform update while code is running? -- Garry Free usenet access athttp://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text - - Show quoted text - Okay, it sounds like you're using the login userform to show a progress bar. If this is the case then your code needs to be something like this: Sub DoStuff() fUserLogin.Show If Not fProgress Is Nothing Then 'do whatever needs fProgress displayed Unload fProgress End If End Sub On fUserLogin, include an OK button that when clicked it validates the login. If (and only if) the login validates then include code to open fProgress vbModeless and unload the login form something like this: Sub cmdOK_Click() If bValidateUserLogin Then fProgress.Show vbModeless Unload Me End Sub ...where bValidateUserLogin is the function that returns the result of login validation as a boolean value (true or false). So.., if login is successful then fProgress displays because your function will return a value of TRUE. If bValidateUserLogin returns false then fProgress isn't opened, and your DoStuff routine will need to know how to handle that. In this case it checks to see if fProgress is open before attempting to do anything and then close it. The code example doesn't let the code execute unless fProgress is open, meaning user login was validated. So to sum up the changes needed, Userform1 should control its own unloading and whether Userform2 is displayed. Your procedure should display Userform1 and execute code then unload Userform2 only if it's loaded. -- Garry Free usenet access at http://www.eternal-september.org ClassicVB Users Regroup! comp.lang.basic.visual.misc |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
fill userform textbox from userform listbox clik event | Excel Programming | |||
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) | Excel Programming | |||
Looping procedure calls userform; how to exit loop (via userform button)? | Excel Programming | |||
Activating userform and filling it with data form row where userform is activate | Excel Programming | |||
Linking userform to userform in Excel 2003 | Excel Programming |