Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default UserForm doesn't show?

Why doesn't this work:

Dim MyUF As UserForm
Set MyUF = UserForm1
MyUF.Show

???


How to set a userform as a variable???


CE
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default UserForm doesn't show?

Charlotte E. explained :
Why doesn't this work:

Dim MyUF As UserForm
Set MyUF = UserForm1
MyUF.Show

???


How to set a userform as a variable???


CE


A UserForm doesn't have a Show method (according to the ObjectLib).

An Object Set to a UserForm does have a Show method.

Example:
Dim MyUF As Object
Set MyUF = UserForm1
MyUF.Show

However, why not just...

UserForm1.Show
...so you don't have the overhead of storing a ref to it in a variable?

--
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: 160
Default UserForm doesn't show?

Thanks :-)

I need my macro to open different userforms on different conditions, and
then perform some actions on them - much easier this way...

CE


Den 11.10.2011 04:49, GS skrev:
Charlotte E. explained :
Why doesn't this work:

Dim MyUF As UserForm
Set MyUF = UserForm1
MyUF.Show

???


How to set a userform as a variable???


CE


A UserForm doesn't have a Show method (according to the ObjectLib).

An Object Set to a UserForm does have a Show method.

Example:
Dim MyUF As Object
Set MyUF = UserForm1
MyUF.Show

However, why not just...

UserForm1.Show
...so you don't have the overhead of storing a ref to it in a variable?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default UserForm doesn't show?

Charlotte E. explained :
Thanks :-)

I need my macro to open different userforms on different conditions, and then
perform some actions on them - much easier this way...

CE


You're welcome!

Depending on the situation.., I use a single userform that changes
according to context via setting the Visible property of frames. I
prefer this to having multiple userforms that only add unnecessary
size/overhead to projects. All frames are managed via a 'ShowPage'
procedure that resets things to the context of the current AppMode
setting.

--
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
SHOW Userform Tom Ogilvy Excel Programming 0 January 24th 07 12:31 AM
show userform john tempest[_2_] Excel Programming 5 May 12th 06 06:07 PM
How to Show a userform from XLA sub Thibault Excel Programming 1 December 8th 03 03:36 PM
show a userform Joe[_17_] Excel Programming 0 July 18th 03 03:25 PM


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

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

About Us

"It's about Microsoft Excel"