Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / May 2006

Tip: Looking for answers? Try searching our database.

UserForm error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Diana Morrison - 19 May 2006 19:18 GMT
I am having trouble with an error message:  Compile error:  method or data
not found (followed "How to create a Userform" by Doug Robbins).  So, I
created a test document following the exact instructions in the same article
and I still get the same message.  Can you help?
Greg Maxey - 19 May 2006 20:07 GMT
Open the VB Editor and step through the code 1 instruction at a time.
Where is the error occuring (what line of code)?

For a bit more on a userform, see:
http://gregmaxey.mvps.org/Validate_UserForm_TextEntry.htm
Diana Morrison - 19 May 2006 21:43 GMT
it happens on the first line of code

.bookmarks("Text1").Range_

> Open the VB Editor and step through the code 1 instruction at a time.
> Where is the error occuring (what line of code)?
>
> For a bit more on a userform, see:
> http://gregmaxey.mvps.org/Validate_UserForm_TextEntry.htm
Greg Maxey - 19 May 2006 22:01 GMT
Ah,

Pull the lines together to eliminate the underscore:

.Bookmarks("Text1").Range.InsertBefore TextBox1
and
.Bookmarks("Text2").Range.InsertBefore TextBox2
Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> it happens on the first line of code
>
[quoted text clipped - 5 lines]
>> For a bit more on a userform, see:
>> http://gregmaxey.mvps.org/Validate_UserForm_TextEntry.htm 
Jay Freedman - 19 May 2006 21:46 GMT
The probable reason, if you retyped the code instead of using cut&paste, is
that you didn't put in the space before the underscore at the ends of the
lines in

    .Bookmarks("Text1").Range _
   .InsertBefore TextBox1
   .Bookmarks("Text2").Range _
   .InsertBefore TextBox2

Because of the font of the web page, those spaces are hard to see, but VBA
requires them.

For an explanation of the underscores, see
http://word.mvps.org/FAQs/MacrosVBA/_AtEndOfLine.htm.

Signature

Regards,
Jay Freedman
Microsoft Word MVP          FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

> I am having trouble with an error message:  Compile error:  method or
> data not found (followed "How to create a Userform" by Doug Robbins).
> So, I created a test document following the exact instructions in the
> same article and I still get the same message.  Can you help?
Diana Morrison - 23 May 2006 16:32 GMT
You're right - worked instantly!  Thanks so much.

Any recommended reading on this subject?  I'd like to be able to better
understand and work with vba for Word.

Thanks!
Diana

> The probable reason, if you retyped the code instead of using cut&paste, is
> that you didn't put in the space before the underscore at the ends of the
[quoted text clipped - 15 lines]
> > So, I created a test document following the exact instructions in the
> > same article and I still get the same message.  Can you help?
Jay Freedman - 24 May 2006 04:42 GMT
Glad I could help.

For reading, start at
http://www.word.mvps.org/FAQs/MacrosVBA/VBABasicsIn15Mins.htm and then
read anything else at http://word.mvps.org/FAQs/MacrosVBA/index.htm
and http://word.mvps.org/FAQs/Userforms/index.htm that looks
interesting.

Then go look at the articles and books listed at
http://word.mvps.org/Tutorials/index.htm and
http://word.mvps.org/Tutorials/FreeToAccess.htm.

Of course, if you still have questions, ask them here!

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

>You're right - worked instantly!  Thanks so much.
>
[quoted text clipped - 23 lines]
>> > So, I created a test document following the exact instructions in the
>> > same article and I still get the same message.  Can you help?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.