WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Intermittent failure to load userform

 
   Home -> Office -> User Forms RSS
Next:  table disordered after closing a file  
Author Message
marjweir

External


Since: Nov 14, 2008
Posts: 4



(Msg. 1) Posted: Fri Nov 14, 2008 12:37 am
Post subject: Intermittent failure to load userform
Archived from groups: microsoft>public>word>vba>userforms (more info?)

I have a 22 page document in Word 2003 in which I have built a
userform called frmDataEntry. It is set to load when the document
opens and at any other time the user clicks the F3 button. This works
most of the time, but sometimes it doesn't. Here are the conditions
under which it most often fails and the unacceptable workaround I have
had to use the overcome that failure:

1. When I start Word and then open the document, it sometimes works
fine and other times not.
2. When it doesn't open the userform, if I invoke the VB Editor and
click on the form and then close the VB editor, then save and close
the document, it usually works when I reopen it.

This is a big document containing a lot of graphics, custom doc
property fields, tables of contents (multiple) and lots of text.

Is there some kind of declaration I should be making in the Module
perhaps? The irregularity of the problem is ruining the project.

In "This Document" I have the following code:
Sub Document_Open()
Load frmDataEntry
frmDataEntry.Show
End sub
Thank you for any insight you can offer.
Back to top
Login to vote
marjweir

External


Since: Nov 14, 2008
Posts: 4



(Msg. 2) Posted: Fri Nov 14, 2008 11:38 am
Post subject: Re: Intermittent failure to load userform [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Nov 14, 5:31 am, "Doug Robbins - Word MVP"
<d....DeleteThis@REMOVECAPSmvps.org> wrote:
> Try
>
> Sub Document_Open()
> Dim myform as frmDataEntry
> Set myform = New  frmDataEntry
> myform.Show
> Set myform = Nothing
> End sub
>
> I question whether this should be a document of a template in which case the
> above code should be in an AutoNew macro
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "marjweir" <Weir.M....DeleteThis@charter.net> wrote in message
>
> news:94ebc953-c254-4ae3-9df9-c05ab84e8f20@35g2000pry.googlegroups.com...
>
>
>
> >I have a 22 page document in Word 2003 in which I have built a
> > userform called frmDataEntry.  It is set to load when the document
> > opens and at any other time the user clicks the F3 button.  This works
> > most of the time, but sometimes it doesn't. Here are the conditions
> > under which it most often fails and the unacceptable workaround I have
> > had to use the overcome that failure:
>
> > 1. When I start Word and then open the document, it sometimes works
> > fine and other times not.
> > 2.  When it doesn't open the userform, if I invoke the VB Editor and
> > click on the form and then close the VB editor, then save and close
> > the document, it usually works when I reopen it.
>
> > This is a big document containing a lot of graphics, custom doc
> > property fields, tables of contents (multiple) and lots of text.
>
> > Is there some kind of declaration I should be making in the Module
> > perhaps?  The irregularity of the problem is ruining the project.
>
> > In "This Document" I have the following code:
> > Sub Document_Open()
> >  Load frmDataEntry
> >  frmDataEntry.Show
> > End sub
> > Thank you for any insight you can offer.- Hide quoted text -
>
> - Show quoted text -

Thanks, Doug.
This will eventually be a template, but I'm still building it in .doc
form.
I want my form to be available via F3 so when action is completed on
the form, I am just hiding it. Later I show it again. Doesn't Set
Myform = nothing have the effect of closing the object so that it
won't be accessible via F3?
Back to top
Login to vote
marjweir

External


Since: Nov 14, 2008
Posts: 4



(Msg. 3) Posted: Fri Nov 14, 2008 12:56 pm
Post subject: Re: Intermittent failure to load userform [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Nov 14, 1:38 pm, marjweir <Weir.M... DeleteThis @charter.net> wrote:
> On Nov 14, 5:31 am, "Doug Robbins - Word MVP"
>
>
>
>
>
> <d... DeleteThis @REMOVECAPSmvps.org> wrote:
> > Try
>
> > Sub Document_Open()
> > Dim myform as frmDataEntry
> > Set myform = New  frmDataEntry
> > myform.Show
> > Set myform = Nothing
> > End sub
>
> > I question whether this should be a document of a template in which case the
> > above code should be in an AutoNew macro
> > --
> > Hope this helps.
>
> > Please reply to the newsgroup unless you wish to avail yourself of my
> > services on a paid consulting basis.
>
> > Doug Robbins - Word MVP
>
> > "marjweir" <Weir.M... DeleteThis @charter.net> wrote in message
>
> >news:94ebc953-c254-4ae3-9df9-c05ab84e8f20@35g2000pry.googlegroups.com...
>
> > >I have a 22 page document in Word 2003 in which I have built a
> > > userform called frmDataEntry.  It is set to load when the document
> > > opens and at any other time the user clicks the F3 button.  This works
> > > most of the time, but sometimes it doesn't. Here are the conditions
> > > under which it most often fails and the unacceptable workaround I have
> > > had to use the overcome that failure:
>
> > > 1. When I start Word and then open the document, it sometimes works
> > > fine and other times not.
> > > 2.  When it doesn't open the userform, if I invoke the VB Editor and
> > > click on the form and then close the VB editor, then save and close
> > > the document, it usually works when I reopen it.
>
> > > This is a big document containing a lot of graphics, custom doc
> > > property fields, tables of contents (multiple) and lots of text.
>
> > > Is there some kind of declaration I should be making in the Module
> > > perhaps?  The irregularity of the problem is ruining the project.
>
> > > In "This Document" I have the following code:
> > > Sub Document_Open()
> > >  Load frmDataEntry
> > >  frmDataEntry.Show
> > > End sub
> > > Thank you for any insight you can offer.- Hide quoted text -
>
> > - Show quoted text -
>
> Thanks, Doug.
> This will eventually be a template, but I'm still building it in .doc
> form.
> I want my form to be available via F3 so when action is completed on
> the form, I am just hiding it. Later I show it again.  Doesn't Set
> Myform = nothing have the effect of closing the object so that it
> won't be accessible via F3?- Hide quoted text -
>
> - Show quoted text -

I tried using your code, but there must be something else wrong. It
fails and reports the error 53 - file not found. When I debug, the
line it fails on is set myform = New frmDataEntry
When I mouseover frmDataEntry, I get <object variable or With block
variable not set>

Here's the Project Explorer content with a new document open (sans the
graphics).
+Normal
-Project(Formdoc) 'this is the template
-Microsoft Word Objects
ThisDocument 'contains subs for Document_New, Document_Open
and Document_Close
-Forms
frmDataEntry
-Modules
Module1 'just contains code for F3
-Project(Mynewdoc) 'new doc created from template
-Microsoft Word Objects
ThisDocument
-References
References to Formdoc.dot

Can you see any reason why it shouldn't be able to find frmDataEntry
or is that just the closest error the system could find?

Thanks.
Back to top
Login to vote
Doug Robbins - Word MVP

External


Since: Jul 14, 2006
Posts: 4293



(Msg. 4) Posted: Fri Nov 14, 2008 9:31 pm
Post subject: Re: Intermittent failure to load userform [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Try

Sub Document_Open()
Dim myform as frmDataEntry
Set myform = New frmDataEntry
myform.Show
Set myform = Nothing
End sub

I question whether this should be a document of a template in which case the
above code should be in an AutoNew macro
--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"marjweir" <Weir.Marj.TakeThisOut@charter.net> wrote in message
news:94ebc953-c254-4ae3-9df9-c05ab84e8f20@35g2000pry.googlegroups.com...
>I have a 22 page document in Word 2003 in which I have built a
> userform called frmDataEntry. It is set to load when the document
> opens and at any other time the user clicks the F3 button. This works
> most of the time, but sometimes it doesn't. Here are the conditions
> under which it most often fails and the unacceptable workaround I have
> had to use the overcome that failure:
>
> 1. When I start Word and then open the document, it sometimes works
> fine and other times not.
> 2. When it doesn't open the userform, if I invoke the VB Editor and
> click on the form and then close the VB editor, then save and close
> the document, it usually works when I reopen it.
>
> This is a big document containing a lot of graphics, custom doc
> property fields, tables of contents (multiple) and lots of text.
>
> Is there some kind of declaration I should be making in the Module
> perhaps? The irregularity of the problem is ruining the project.
>
> In "This Document" I have the following code:
> Sub Document_Open()
> Load frmDataEntry
> frmDataEntry.Show
> End sub
> Thank you for any insight you can offer.
Back to top
Login to vote
Doug Robbins - Word MVP

External


Since: Jul 14, 2006
Posts: 4293



(Msg. 5) Posted: Sat Nov 15, 2008 3:02 am
Post subject: Re: Intermittent failure to load userform [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

It would depend upon what code you are invoking by the use of F3.

There is no reason not to start with a template.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"marjweir" <Weir.Marj.RemoveThis@charter.net> wrote in message
news:e8f21d41-c69f-4406-94c3-bd2ab96516ce@s9g2000prg.googlegroups.com...
On Nov 14, 5:31 am, "Doug Robbins - Word MVP"
<d....RemoveThis@REMOVECAPSmvps.org> wrote:
> Try
>
> Sub Document_Open()
> Dim myform as frmDataEntry
> Set myform = New frmDataEntry
> myform.Show
> Set myform = Nothing
> End sub
>
> I question whether this should be a document of a template in which case
> the
> above code should be in an AutoNew macro
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "marjweir" <Weir.M....RemoveThis@charter.net> wrote in message
>
> news:94ebc953-c254-4ae3-9df9-c05ab84e8f20@35g2000pry.googlegroups.com...
>
>
>
> >I have a 22 page document in Word 2003 in which I have built a
> > userform called frmDataEntry. It is set to load when the document
> > opens and at any other time the user clicks the F3 button. This works
> > most of the time, but sometimes it doesn't. Here are the conditions
> > under which it most often fails and the unacceptable workaround I have
> > had to use the overcome that failure:
>
> > 1. When I start Word and then open the document, it sometimes works
> > fine and other times not.
> > 2. When it doesn't open the userform, if I invoke the VB Editor and
> > click on the form and then close the VB editor, then save and close
> > the document, it usually works when I reopen it.
>
> > This is a big document containing a lot of graphics, custom doc
> > property fields, tables of contents (multiple) and lots of text.
>
> > Is there some kind of declaration I should be making in the Module
> > perhaps? The irregularity of the problem is ruining the project.
>
> > In "This Document" I have the following code:
> > Sub Document_Open()
> > Load frmDataEntry
> > frmDataEntry.Show
> > End sub
> > Thank you for any insight you can offer.- Hide quoted text -
>
> - Show quoted text -

Thanks, Doug.
This will eventually be a template, but I'm still building it in .doc
form.
I want my form to be available via F3 so when action is completed on
the form, I am just hiding it. Later I show it again. Doesn't Set
Myform = nothing have the effect of closing the object so that it
won't be accessible via F3?
Back to top
Login to vote
Doug Robbins - Word MVP

External


Since: Jul 14, 2006
Posts: 4293



(Msg. 6) Posted: Sat Nov 15, 2008 3:02 am
Post subject: Re: Intermittent failure to load userform [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

If you want to send me a copy of the template, I will take a look at it.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"marjweir" <Weir.Marj.TakeThisOut@charter.net> wrote in message
news:7d457c4c-09c9-45aa-9d1b-105606e363f6@i18g2000prf.googlegroups.com...
On Nov 14, 1:38 pm, marjweir <Weir.M....TakeThisOut@charter.net> wrote:
> On Nov 14, 5:31 am, "Doug Robbins - Word MVP"
>
>
>
>
>
> <d....TakeThisOut@REMOVECAPSmvps.org> wrote:
> > Try
>
> > Sub Document_Open()
> > Dim myform as frmDataEntry
> > Set myform = New frmDataEntry
> > myform.Show
> > Set myform = Nothing
> > End sub
>
> > I question whether this should be a document of a template in which case
> > the
> > above code should be in an AutoNew macro
> > --
> > Hope this helps.
>
> > Please reply to the newsgroup unless you wish to avail yourself of my
> > services on a paid consulting basis.
>
> > Doug Robbins - Word MVP
>
> > "marjweir" <Weir.M....TakeThisOut@charter.net> wrote in message
>
> >news:94ebc953-c254-4ae3-9df9-c05ab84e8f20@35g2000pry.googlegroups.com...
>
> > >I have a 22 page document in Word 2003 in which I have built a
> > > userform called frmDataEntry. It is set to load when the document
> > > opens and at any other time the user clicks the F3 button. This works
> > > most of the time, but sometimes it doesn't. Here are the conditions
> > > under which it most often fails and the unacceptable workaround I have
> > > had to use the overcome that failure:
>
> > > 1. When I start Word and then open the document, it sometimes works
> > > fine and other times not.
> > > 2. When it doesn't open the userform, if I invoke the VB Editor and
> > > click on the form and then close the VB editor, then save and close
> > > the document, it usually works when I reopen it.
>
> > > This is a big document containing a lot of graphics, custom doc
> > > property fields, tables of contents (multiple) and lots of text.
>
> > > Is there some kind of declaration I should be making in the Module
> > > perhaps? The irregularity of the problem is ruining the project.
>
> > > In "This Document" I have the following code:
> > > Sub Document_Open()
> > > Load frmDataEntry
> > > frmDataEntry.Show
> > > End sub
> > > Thank you for any insight you can offer.- Hide quoted text -
>
> > - Show quoted text -
>
> Thanks, Doug.
> This will eventually be a template, but I'm still building it in .doc
> form.
> I want my form to be available via F3 so when action is completed on
> the form, I am just hiding it. Later I show it again. Doesn't Set
> Myform = nothing have the effect of closing the object so that it
> won't be accessible via F3?- Hide quoted text -
>
> - Show quoted text -

I tried using your code, but there must be something else wrong. It
fails and reports the error 53 - file not found. When I debug, the
line it fails on is set myform = New frmDataEntry
When I mouseover frmDataEntry, I get <object variable or With block
variable not set>

Here's the Project Explorer content with a new document open (sans the
graphics).
+Normal
-Project(Formdoc) 'this is the template
-Microsoft Word Objects
ThisDocument 'contains subs for Document_New, Document_Open
and Document_Close
-Forms
frmDataEntry
-Modules
Module1 'just contains code for F3
-Project(Mynewdoc) 'new doc created from template
-Microsoft Word Objects
ThisDocument
-References
References to Formdoc.dot

Can you see any reason why it shouldn't be able to find frmDataEntry
or is that just the closest error the system could find?

Thanks.
Back to top
Login to vote
marjweir

External


Since: Nov 14, 2008
Posts: 4



(Msg. 7) Posted: Sun Nov 16, 2008 2:26 pm
Post subject: Re: Intermittent failure to load userform [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Nov 14, 8:43 pm, "Doug Robbins - Word MVP"
<d... DeleteThis @REMOVECAPSmvps.org> wrote:
> If you want to send me a copy of the template, I will take a look at it.
>
> --
> Hope this helps.
>
> Please reply to the newsgroup unless you wish to avail yourself of my
> services on a paid consulting basis.
>
> Doug Robbins - Word MVP
>
> "marjweir" <Weir.M... DeleteThis @charter.net> wrote in message
>
> news:7d457c4c-09c9-45aa-9d1b-105606e363f6@i18g2000prf.googlegroups.com...
> On Nov 14, 1:38 pm, marjweir <Weir.M... DeleteThis @charter.net> wrote:
>
>
>
>
>
> > On Nov 14, 5:31 am, "Doug Robbins - Word MVP"
>
> > <d... DeleteThis @REMOVECAPSmvps.org> wrote:
> > > Try
>
> > > Sub Document_Open()
> > > Dim myform as frmDataEntry
> > > Set myform = New frmDataEntry
> > > myform.Show
> > > Set myform = Nothing
> > > End sub
>
> > > I question whether this should be a document of a template in which case
> > > the
> > > above code should be in an AutoNew macro
> > > --
> > > Hope this helps.
>
> > > Please reply to the newsgroup unless you wish to avail yourself of my
> > > services on a paid consulting basis.
>
> > > Doug Robbins - Word MVP
>
> > > "marjweir" <Weir.M... DeleteThis @charter.net> wrote in message
>
> > >news:94ebc953-c254-4ae3-9df9-c05ab84e8f20@35g2000pry.googlegroups.com....
>
> > > >I have a 22 page document in Word 2003 in which I have built a
> > > > userform called frmDataEntry. It is set to load when the document
> > > > opens and at any other time the user clicks the F3 button. This works
> > > > most of the time, but sometimes it doesn't. Here are the conditions
> > > > under which it most often fails and the unacceptable workaround I have
> > > > had to use the overcome that failure:
>
> > > > 1. When I start Word and then open the document, it sometimes works
> > > > fine and other times not.
> > > > 2. When it doesn't open the userform, if I invoke the VB Editor and
> > > > click on the form and then close the VB editor, then save and close
> > > > the document, it usually works when I reopen it.
>
> > > > This is a big document containing a lot of graphics, custom doc
> > > > property fields, tables of contents (multiple) and lots of text.
>
> > > > Is there some kind of declaration I should be making in the Module
> > > > perhaps? The irregularity of the problem is ruining the project.
>
> > > > In "This Document" I have the following code:
> > > > Sub Document_Open()
> > > > Load frmDataEntry
> > > > frmDataEntry.Show
> > > > End sub
> > > > Thank you for any insight you can offer.- Hide quoted text -
>
> > > - Show quoted text -
>
> > Thanks, Doug.
> > This will eventually be a template, but I'm still building it in .doc
> > form.
> > I want my form to be available via F3 so when action is completed on
> > the form, I am just hiding it. Later I show it again. Doesn't Set
> > Myform = nothing have the effect of closing the object so that it
> > won't be accessible via F3?- Hide quoted text -
>
> > - Show quoted text -
>
> I tried using your code, but there must be something else wrong.  It
> fails and reports the error 53 - file not found.  When I debug, the
> line it fails on is set myform = New frmDataEntry
> When I mouseover frmDataEntry, I get <object variable or With block
> variable not set>
>
> Here's the Project Explorer content with a new document open (sans the
> graphics).
> +Normal
> -Project(Formdoc)        'this is the template
>   -Microsoft Word Objects
>       ThisDocument   'contains subs for Document_New, Document_Open
> and Document_Close
>   -Forms
>        frmDataEntry
>   -Modules
>        Module1            'just contains code for F3
> -Project(Mynewdoc)  'new doc created from template
>   -Microsoft Word Objects
>       ThisDocument
>   -References
>       References to Formdoc.dot
>
> Can you see any reason why it shouldn't be able to find frmDataEntry
> or is that just the closest error the system could find?
>
> Thanks.- Hide quoted text -
>
> - Show quoted text -

Well, I think I figured it out. The problem was with code within the
form. I guess it wouldn't load it because it couldn't find a text
file that was in the same directory, but did not have a path
explicitly identified. It works consistently on my development pc now
that I have created an explicit file path for the text file the form
grabs data from.

Once again, "Assume nothing" seems to be wise.

Thanks.
Marj
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> User Forms All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET |
  • IT Support