|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Runtime Error 91I have created a simple Word template with bookmarks for entering
text. I receive "Runtime Error 91 Object variable or With block variable not set" when I click the OK button. The template info populates into the Word form nonetheless. I believe I need a Set command, but am not sure what I need or how to write it, as I am a novice at VB. Private Sub Document_New() frmSeminarRequest.Show End Sub Can anyone recommend a fix for this error? Thanks in advance dweit***@dowlohnes.com's wild thoughts were released on Tue,
9 Dec 2008 08:30:41 -0800 (PST) bearing the following fruit: >I have created a simple Word template with bookmarks for entering You need to post the line of code the error occurs on.>text. I receive "Runtime Error 91 Object variable or With block >variable not set" when I click the OK button. The template info >populates into the Word form nonetheless. I believe I need a Set >command, but am not sure what I need or how to write it, as I am a >novice at VB. > >Private Sub Document_New() > frmSeminarRequest.Show > End Sub > >Can anyone recommend a fix for this error? Thanks in advance -- Jan Hyde (VB MVP) https://mvp.support.microsoft.com/profile/Jan.Hyde On Dec 9, 11:52 am, "Jan Hyde (VB MVP)"
<StellaDrin***@REMOVE.ME.uboot.com> wrote: Show quoteHide quote > dweit***@dowlohnes.com's wild thoughts were released on Tue, error appears on frmSeminarRequest.Show line is highlighted.> 9 Dec 2008 08:30:41 -0800 (PST) bearing the following fruit: > > >I have created a simple Word template with bookmarks for entering > >text. I receive "Runtime Error 91 Object variable or With block > >variable not set" when I click the OK button. The template info > >populates into the Word form nonetheless. I believe I need a Set > >command, but am not sure what I need or how to write it, as I am a > >novice at VB. > > >Private Sub Document_New() > > frmSeminarRequest.Show > > End Sub > > >Can anyone recommend a fix for this error? Thanks in advance > > You need to post the line of code the error occurs on. > -- > Jan Hyde (VB MVP) > > https://mvp.support.microsoft.com/profile/Jan.Hyde I think what Jan was getting at was that something happens in
frmSeminarRequest (Load, Initialize) that is causing an issue. Put a break point out there and step through, or put error trapping out there to report where the issue is coming from. Generically speaking error 91 means an object was not set or initiliazed before attempting to use it. So if frmSeminarRequest is initialized, then it should be an object you are attempting to access in the load or initilize events of the form. <dweit***@dowlohnes.com> wrote in message news:ccc5266c-d988-457a-a91e-5a2bda763301@e3g2000vbe.googlegroups.com... On Dec 9, 11:52 am, "Jan Hyde (VB MVP)"<StellaDrin***@REMOVE.ME.uboot.com> wrote: Show quoteHide quote > dweit***@dowlohnes.com's wild thoughts were released on Tue, error appears on frmSeminarRequest.Show line is highlighted.> 9 Dec 2008 08:30:41 -0800 (PST) bearing the following fruit: > > >I have created a simple Word template with bookmarks for entering > >text. I receive "Runtime Error 91 Object variable or With block > >variable not set" when I click the OK button. The template info > >populates into the Word form nonetheless. I believe I need a Set > >command, but am not sure what I need or how to write it, as I am a > >novice at VB. > > >Private Sub Document_New() > > frmSeminarRequest.Show > > End Sub > > >Can anyone recommend a fix for this error? Thanks in advance > > You need to post the line of code the error occurs on. > -- > Jan Hyde (VB MVP) > > https://mvp.support.microsoft.com/profile/Jan.Hyde
Show quote
Hide quote
On Dec 9, 12:50 pm, "amdrit" <amd***@hotmail.com> wrote: Thanks Amdrit. That sorta makes sense to me (novice), but I'm unclear> I think what Jan was getting at was that something happens in > frmSeminarRequest (Load, Initialize) that is causing an issue. Put a break > point out there and step through, or put error trapping out there to report > where the issue is coming from. > > Generically speaking error 91 means an object was not set or initiliazed > before attempting to use it. So if frmSeminarRequest is initialized, then > it should be an object you are attempting to access in the load or initilize > events of the form. > > <dweit***@dowlohnes.com> wrote in message > > news:ccc5266c-d988-457a-a91e-5a2bda763301@e3g2000vbe.googlegroups.com... > On Dec 9, 11:52 am, "Jan Hyde (VB MVP)" > > > > > > <StellaDrin***@REMOVE.ME.uboot.com> wrote: > > dweit***@dowlohnes.com's wild thoughts were released on Tue, > > 9 Dec 2008 08:30:41 -0800 (PST) bearing the following fruit: > > > >I have created a simple Word template with bookmarks for entering > > >text. I receive "Runtime Error 91 Object variable or With block > > >variable not set" when I click the OK button. The template info > > >populates into the Word form nonetheless. I believe I need a Set > > >command, but am not sure what I need or how to write it, as I am a > > >novice at VB. > > > >Private Sub Document_New() > > > frmSeminarRequest.Show > > > End Sub > > > >Can anyone recommend a fix for this error? Thanks in advance > > > You need to post the line of code the error occurs on. > > -- > > Jan Hyde (VB MVP) > > >https://mvp.support.microsoft.com/profile/Jan.Hyde > > error appears on frmSeminarRequest.Show line is highlighted.- Hide quoted text - > > - Show quoted text - on how to set the object variable or what the next line of code should be. Set a breakpoint on this line...
> > > frmSeminarRequest.Show When VB stops on that line, right click the code window and select Toggle/Break On Unhandled Errors... then, hit F5 to continue running. VB should then stop on the line that actually raised the error. If "frmSeminarRequest" is a variable name, and not an actual form's name, you will need that "Set" statement you mentioned. It would look like... Set frmSeminarRequest = New ActualNameOfForm frmSeminarRequest.Show <dweit***@dowlohnes.com> wrote in message news:b791796a-ca7f-433e-ab01-5658a39161a8@r34g2000vbp.googlegroups.com... Thanks Amdrit. That sorta makes sense to me (novice), but I'm unclearOn Dec 9, 12:50 pm, "amdrit" <amd***@hotmail.com> wrote: on how to set the object variable or what the next line of code should be. Hi dweiters,
What is frmSeminarRequest ? Are you sure the name is correct ? Try adding Option Explicit to the code module and see if it gives you an error. <dweit***@dowlohnes.com> wrote in message Show quoteHide quote news:6b742825-4430-4796-a89c-c1d7fddd16f3@r32g2000vba.googlegroups.com... >I have created a simple Word template with bookmarks for entering > text. I receive "Runtime Error 91 Object variable or With block > variable not set" when I click the OK button. The template info > populates into the Word form nonetheless. I believe I need a Set > command, but am not sure what I need or how to write it, as I am a > novice at VB. > > Private Sub Document_New() > frmSeminarRequest.Show > End Sub > > Can anyone recommend a fix for this error? Thanks in advance
need a thumbnail browser without memory limitations
Set 'Media Type' for VB's Printer object File system change notifications instance a class from its class name Has McCarthy been sacked! Get Control IDs more efficiently Opentextfile TriStateMixed How many characters wide should posts be? Parent Controls New Desktop Folder |
|||||||||||||||||||||||