JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for EXCEL-VB-DISCUSS Archives


EXCEL-VB-DISCUSS Archives

EXCEL-VB-DISCUSS Archives


EXCEL-VB-DISCUSS@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

EXCEL-VB-DISCUSS Home

EXCEL-VB-DISCUSS Home

EXCEL-VB-DISCUSS  December 2001

EXCEL-VB-DISCUSS December 2001

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

FW: VBA query about userforms

From:

"Allcock, Neil" <[log in to unmask]>

Reply-To:

A list to stimulate discussion about the technical aspects of the developme <[log in to unmask]>

Date:

Thu, 6 Dec 2001 12:28:42 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (188 lines)

Hello there,
I got this message from a Word list...
is there any validity to it?
"The latter is much better and robust "
NEil

> -----Original Message-----
> From: Malcolm K Smith [SMTP:[log in to unmask]]
> Sent: Thursday, December 06, 2001 9:57 AM
> To:   [log in to unmask]
> Subject:      Re: VBA query about userforms
>
> Doug
>
> My concern is how the form is called.
>
> If the form is called, say, frmMyForm then it can be called as such:
>
>    frmMyForm.Show
>
> or
>
>    Dim objForm as frmMyForm
>    Set objForm = New frmMyForm
>    objForm.Show
>
>
> The latter is much better and robust and all sorts can go horribly wrong
> if
> the first way of calling the form is used.
>
> In fact the first way should never be used.   What happens in your code?
>
> Malc
>   www.dragondrop.com
>
> -----Original Message-----
> From: Doug Hein [mailto:[log in to unmask]]
> Sent: 06 December 2001 01:43
> To: [log in to unmask]
> Subject: Re: VBA query about userforms
>
>
> Thanks, Steve and Malcolm.
> Every so often I lapse into thinking something in Word would actually work
> as one would expect and require a figurative slap to bring me back to
> reality.  I think all I really sought here was confirmation that such was
> the case, not a solution.  However, regarding the situation, since the
> userform is shown with the Show method, I tried switching
> "UserForm_Initialize" to "UserForm_Activate" in the subroutine name
> (leaving
> all the code exactly as it was before), and early tests look good: the
> code
> is running to populate the defaults in the dialog up front, and it's _not_
> partially running again after OK is clicked (woo-hoo).
>
> Even my exasperated posts find worthwhile answers.  Is this a great list
> or
> what?
>
> Doug
>
> -----Original Message-----
> From: Steve Hudson [mailto:[log in to unmask]]
> Sent: Tuesday, December 04, 2001 6:50 PM
> To: [log in to unmask]
> Subject: Re: VBA query about userforms
>
> *groan* Why is it everyone is coming up the worst features in Word lately?
> Sorry if the answer is a bit vague, but the whole thing is a gray mess.
>
> Initialise can be forced to run, AFAIK, by .Load ing the dialog before
> showing it in those situations where it doesnt work properly. Some folks
> choose to use the UserForm_Activate routine instead.
>
> Technically speaking, not 100% practically obviously, the init event runs
> when any object is initialised. Userforms are a type of object. So doing a
>
> Dim MyForm as ThisUserForm
>
> wont do diddly, but either
>
> Dim MyForm as New ThisUserForm
>
> or
>
> Set MyForm=ThisUserForm
>
> SHOULD run the init event. It is also supposed to run before a .show
> method,
> but this is exactly where you having the problems I'll bet.
>
> The activate event is triggered by moving the focus within an application.
> Moving the focus to or from an object in another application doesn't
> trigger
> either event.
>
> An object can become active by using the Show method in code. The Activate
> event can occur only when an object is visible. A UserForm loaded with
> Load
> isn't visible unless you use the Show method.
>
> The Deactivate event doesn't occur when unloading an object.
>
> -----Original Message-----
> From: Doug Hein
>
> I am dealing with custom dialog boxes, aka userforms in VBA speak.  That
> much I know.  In the code for the userform, there is a subroutine called
> UserForm_Initialize.  I was of the opinion that this was what ran when the
> userform was first called, setting default values for the elements, etc.
> However, in tracking some variables through the macro calling the userform
> with everyone's favorite little message boxes, I've discovered that the
> entire code in there doesn't appear to run before the userform actually
> displays on the screen (under certain circumstances--we won't get into
> that), and that some of the code in said subroutine runs after CmdOK_Click
> (what happens when one clicks OK) code has finished doing its business.
> Don't ask about the particulars of the macro--I'm not saying it's not
> screwed up.  All I really want to know now, since the books I have don't
> mention this particular topic and the cursory scan on the net has not come
> up fruitful, is:
> Can anyone tell me specifically what the UserForm_Initialize subroutine is
> REALLY supposed to do?
>
> **************************************************************************
> **
> **************************************************************************
> **
> ******************************************
>
> The contents of this e-mail message, including any attachments, are
> intended
> solely for the use of the person or entity to whom the e-mail was
> addressed.
> It contains information that may be protected by the attorney-client
> privilege, work-product doctrine, or other privileges, and may be
> restricted
> from disclosure by applicable state and federal law. If you are not the
> intended recipient of this message, be advised that any dissemination,
> distribution, or use of the contents of this message is strictly
> prohibited.
> If you received this e-mail message in error, please e-mail
> [log in to unmask] and contact the sender by reply e-mail.
> Please also permanently delete all copies of the original e-mail and any
> attached documentation. Thank you.
> Sheppard, Mullin, Richter & Hampton LLP
> http://www.sheppardmullin.com
>
> **************************************************************************
> **
> **************************************************************************
> **
> ********************************************
>  We have changed our e-mail address. Our new domain name is
> sheppardmullin.com. In most cases, our email addresses are composed of a
> person's first name inital and last name plus @[log in to unmask] For
> example, John Smith's email address would be [log in to unmask] If
> you have any questions, please contact [log in to unmask]
>
> --
> mailto:[log in to unmask]  to leave
> mailto:[log in to unmask] to join
> (no subject or command text required)
> http://listserv.liv.ac.uk/archives/word-pc.html
>
> --
> mailto:[log in to unmask]  to leave
> mailto:[log in to unmask] to join
> (no subject or command text required)
> http://listserv.liv.ac.uk/archives/word-pc.html
>
Information contained in this message is confidential and may be legally
privileged and is intended for the addressee only. If you have received this
message in error or there are any problems please notify the originator
immediately.
The unauthorised use, disclosure, copying or alteration of this message is
strictly forbidden. The mail and any attachments have been scanned for
viruses prior to leaving English, Welsh & Scottish Railway's Ltd's (EWS)
network. EWS Ltd will not be liable for direct, special, indirect or
consequential damages arising from alteration of the contents of this
message by a third party or as a result of any virus being passed on.
Internet e-mails are not necessarily secure. EWS does not accept
responsibilty for changes to any e-mail which occur after it is sent. For
more information about EWS Ltd, please see our website:-
www.ews-railway.co.uk
English Welsh & Scottish Railway Limited
Registered Office: 310 Goswell Road London EC1V 7LW.
Registered in England and Wales - Registered No : 2938988

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

September 2015
February 2012
November 2011
October 2011
September 2011
July 2011
June 2011
April 2011
March 2011
February 2011
August 2010
June 2010
May 2010
January 2010
November 2009
September 2009
August 2009
July 2009
January 2009
September 2008
August 2008
July 2008
June 2008
May 2008
March 2008
February 2008
January 2008
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
May 2005
April 2005
March 2005
February 2005
January 2005
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
January 2001
December 2000
November 2000
October 2000
September 2000
August 2000
July 2000
June 2000
May 2000
April 2000
March 2000
February 2000
January 2000
December 1999
November 1999
October 1999
September 1999
August 1999
July 1999
June 1999
May 1999
April 1999
March 1999
February 1999
January 1999
December 1998
November 1998
October 1998
September 1998
August 1998
July 1998
June 1998
May 1998
April 1998
March 1998


WWW.JISCMAIL.AC.UK

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager