Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Excel Userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Excel Userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Excel Userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Excel Userform

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fill userform textbox from userform listbox clik event GregJG[_21_] Excel Programming 3 December 7th 08 04:47 PM
Is there an easy Copy/Paste of a Userform ? (Entire Userform Including tx & cbx's) Corey Excel Programming 2 January 9th 07 01:01 PM
Looping procedure calls userform; how to exit loop (via userform button)? KR Excel Programming 6 July 27th 05 12:57 PM
Activating userform and filling it with data form row where userform is activate Marthijn Beusekom via OfficeKB.com[_2_] Excel Programming 3 May 6th 05 05:44 PM
Linking userform to userform in Excel 2003 missmelis01 Excel Programming 2 August 27th 04 08:07 PM


All times are GMT +1. The time now is 10:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"