G'Day all!

Can someone please tell me why the following would suddenly stop running?

Private Sub Document_New()
UserForm1.Show
End Sub

I have created UserForm1 in my template and the form was loading correctly
on opening a new document based on that template. I have since edited the
fields on UserForm1 but the name is unchanged.

I am now getting:

Run-time Error '5941':
The requested member of the collection does not exist

Any suggestions gratefully received!

--
AnnieB
Basic Babe in the Woods

Re: Autonew macro won't run by Helmut

Helmut
Sun Oct 21 01:14:01 PDT 2007

Hi,

you may try to export userform1
delete it and import it again.

But whether that helps is uncertain.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

RE: Autonew macro won't run by AnnieB

AnnieB
Sun Oct 21 01:37:01 PDT 2007

Okay - I went back to my form and removed some of the fields and it now
works. Is there a restriction on the number of fields that can be added to a
userform?

--
AnnieB
Basic Babe in the Woods



"AnnieB" wrote:

> G'Day all!
>
> Can someone please tell me why the following would suddenly stop running?
>
> Private Sub Document_New()
> UserForm1.Show
> End Sub
>
> I have created UserForm1 in my template and the form was loading correctly
> on opening a new document based on that template. I have since edited the
> fields on UserForm1 but the name is unchanged.
>
> I am now getting:
>
> Run-time Error '5941':
> The requested member of the collection does not exist
>
> Any suggestions gratefully received!
>
> --
> AnnieB
> Basic Babe in the Woods
>

Re: Autonew macro won't run by AnnieB

AnnieB
Sun Oct 21 03:06:00 PDT 2007

Thanks Helmut,

That was one of the first things I tried but with no luck!
--
AnnieB
Basic Babe in the Woods



"Helmut Weber" wrote:

> Hi,
>
> you may try to export userform1
> delete it and import it again.
>
> But whether that helps is uncertain.
>
> --
> Greetings from Bavaria, Germany
>
> Helmut Weber, MVP WordVBA
>
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
>

Re: Autonew macro won't run by Russ

Russ
Sun Oct 21 13:42:24 PDT 2007

AnnieB,
It would be helpful if you could show us the exact line where the error
occurs. And then show us that line and its short surrounding (which event,
if on a userform) subroutine.
It may be that it is referring to a bookmark or form field or AutoText or
some other named or numbered item in a collection, in your document, that
you have not yet established or misnamed (typo?) in reference.
---------------
Some typos can be caught if you always use:
Option Explicit

in the (Declarations) section of each of your projects.
Then, the compiler forces you to correctly spell or declare a variable
before using it.
See this webpage for more information on declaring variables:
http://word.mvps.org/faqs/macrosvba/DeclareVariables.htm
----------------
In your post title you mention Autonew, while in the message body you use
Document_New. They are different, but related events.
See this webpage for more information on document events:
http://word.mvps.org/faqs/macrosvba/DocumentEvents.htm

> G'Day all!
>
> Can someone please tell me why the following would suddenly stop running?
>
> Private Sub Document_New()
> UserForm1.Show
> End Sub
>
> I have created UserForm1 in my template and the form was loading correctly
> on opening a new document based on that template. I have since edited the
> fields on UserForm1 but the name is unchanged.
>
> I am now getting:
>
> Run-time Error '5941':
> The requested member of the collection does not exist
>
> Any suggestions gratefully received!

--
Russ

drsmN0SPAMikleAThotmailD0Tcom.INVALID