|
|
|
date: Sat, 28 Jan 2006 17:03:26 -0800,
group: microsoft.public.word.setup.networking
back
Left function triggers Compile error: Can't find project or libra
The macro below works just fine...when it's located in a userform I
made, in which the macro is named: Private Sub btnPath_Click()
But I want to remove the macro from the userform, place the programming
in the NewMacros module of the same .dot file [but with the new name:
Boopsie()]), and have the Private Sub btnPath_Click macro call the boopsie
macro.
Unfortuntately, Boopsie doesn't work. Boopsie generates the following
error message: Compile error: Can't find project or library Ok Help
Does anyone have any ideas what is causing the problem, and how to fix it?
Thanks, Marceepoo
Here's the macro, as it appears in the NewMacros module of the same .dot file:
Sub Boopsie()
'
' Copy path to strVar and then to clipboard
'
'frmMenuGnlAccess.Hide
ActiveDocument.ActiveWindow.SetFocus
Dim strFulNam As String, strPath As String
Dim lLenLFileNam As Integer, lLenPthTemp As Integer
Dim MyPath As DataObject
Set MyPath = New DataObject
strFulNam = ActiveDocument.FullName
lLenPthTemp = Len(strFulNam)
lLenLFileNam = InStrRev(strFulNam, "\")
strPath = Left(strFulNam, lLenLFileNam)
'MsgBox strFulNam & vbCrLf & strPath
MyPath.SetText strPath
MyPath.PutInClipboard
'
End Sub
date: Sat, 28 Jan 2006 17:03:26 -0800
author: Marceepoo alias
Re: Left function triggers Compile error: Can't find project or libra
No error here when running that code. What do you have checked under
Tools>References in the Visual Basic Editor?
Here I have the following (some of which maybe because of other
macros/add-ins loaded on my system)
Visual Basic For Applications
Microsoft Word 11.0 Object Library
OLE Automation
Microsoft Office 11.0 Object Library
Microsoft Forms 2.0 Object Library
Microsoft DAO 3.6 Object Library
--
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
"Marceepoo" <36c53a08-2073470544@news.postalias> wrote in message
news:8AB4B3D9-D993-47D4-9FD6-46F13B846EC6@microsoft.com...
> The macro below works just fine...when it's located in a userform I
> made, in which the macro is named: Private Sub btnPath_Click()
> But I want to remove the macro from the userform, place the programming
> in the NewMacros module of the same .dot file [but with the new name:
> Boopsie()]), and have the Private Sub btnPath_Click macro call the boopsie
> macro.
> Unfortuntately, Boopsie doesn't work. Boopsie generates the following
> error message: Compile error: Can't find project or library Ok Help
> Does anyone have any ideas what is causing the problem, and how to fix
> it?
> Thanks, Marceepoo
>
> Here's the macro, as it appears in the NewMacros module of the same .dot
> file:
>
> Sub Boopsie()
> '
> ' Copy path to strVar and then to clipboard
> '
> 'frmMenuGnlAccess.Hide
> ActiveDocument.ActiveWindow.SetFocus
> Dim strFulNam As String, strPath As String
> Dim lLenLFileNam As Integer, lLenPthTemp As Integer
> Dim MyPath As DataObject
>
> Set MyPath = New DataObject
>
> strFulNam = ActiveDocument.FullName
>
> lLenPthTemp = Len(strFulNam)
> lLenLFileNam = InStrRev(strFulNam, "\")
> strPath = Left(strFulNam, lLenLFileNam)
>
>
> 'MsgBox strFulNam & vbCrLf & strPath
> MyPath.SetText strPath
> MyPath.PutInClipboard
> '
> End Sub
>
date: Sun, 29 Jan 2006 08:16:16 +0100
author: Doug Robbins - Word MVP
Re: Left function triggers Compile error: Can't find project or l
Dear Doug:
1. Thanks for responding. 2.I found all of them checked, except
Microsoft DAO 3.6 Object Library; so I checked that one too. Then I closed
Word, reopened and ... still the same problem.
Any suggestions? (Thanks again for helping. It's much appreciated.)
Marceepoo
"Doug Robbins - Word MVP" wrote:
> No error here when running that code. What do you have checked under
> Tools>References in the Visual Basic Editor?
>
> Here I have the following (some of which maybe because of other
> macros/add-ins loaded on my system)
>
> Visual Basic For Applications
> Microsoft Word 11.0 Object Library
> OLE Automation
> Microsoft Office 11.0 Object Library
> Microsoft Forms 2.0 Object Library
> Microsoft DAO 3.6 Object Library
>
> --
> 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
>
> "Marceepoo" <36c53a08-2073470544@news.postalias> wrote in message
> news:8AB4B3D9-D993-47D4-9FD6-46F13B846EC6@microsoft.com...
> > The macro below works just fine...when it's located in a userform I
> > made, in which the macro is named: Private Sub btnPath_Click()
> > But I want to remove the macro from the userform, place the programming
> > in the NewMacros module of the same .dot file [but with the new name:
> > Boopsie()]), and have the Private Sub btnPath_Click macro call the boopsie
> > macro.
> > Unfortuntately, Boopsie doesn't work. Boopsie generates the following
> > error message: Compile error: Can't find project or library Ok Help
> > Does anyone have any ideas what is causing the problem, and how to fix
> > it?
> > Thanks, Marceepoo
> >
> > Here's the macro, as it appears in the NewMacros module of the same .dot
> > file:
> >
> > Sub Boopsie()
> > '
> > ' Copy path to strVar and then to clipboard
> > '
> > 'frmMenuGnlAccess.Hide
> > ActiveDocument.ActiveWindow.SetFocus
> > Dim strFulNam As String, strPath As String
> > Dim lLenLFileNam As Integer, lLenPthTemp As Integer
> > Dim MyPath As DataObject
> >
> > Set MyPath = New DataObject
> >
> > strFulNam = ActiveDocument.FullName
> >
> > lLenPthTemp = Len(strFulNam)
> > lLenLFileNam = InStrRev(strFulNam, "\")
> > strPath = Left(strFulNam, lLenLFileNam)
> >
> >
> > 'MsgBox strFulNam & vbCrLf & strPath
> > MyPath.SetText strPath
> > MyPath.PutInClipboard
> > '
> > End Sub
> >
>
>
>
date: Sun, 29 Jan 2006 17:21:27 -0800
author: Marceepoo alias
Re: Left function triggers Compile error: Can't find project or l
Sorry, I do not get an error when running the following code here:
ActiveDocument.ActiveWindow.SetFocus
Dim strFulNam As String, strPath As String
Dim lLenLFileNam As Integer, lLenPthTemp As Integer
Dim MyPath As DataObject
Set MyPath = New DataObject
strFulNam = ActiveDocument.FullName
lLenPthTemp = Len(strFulNam)
lLenLFileNam = InStrRev(strFulNam, "\")
strPath = Left(strFulNam, lLenLFileNam)
MsgBox strFulNam & vbCrLf & strPath
MyPath.SetText strPath
MyPath.PutInClipboard
and if I then use Ctrl+c, the path of the active document is pasted into the
selection.
--
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
"Marceepoo" <36c53a08-2073470544@news.postalias> wrote in message
news:B27624DE-B9A1-4518-A359-DCC7DEBA33B7@microsoft.com...
> Dear Doug:
>
> 1. Thanks for responding. 2.I found all of them checked, except
> Microsoft DAO 3.6 Object Library; so I checked that one too. Then I
> closed
> Word, reopened and ... still the same problem.
> Any suggestions? (Thanks again for helping. It's much appreciated.)
> Marceepoo
>
> "Doug Robbins - Word MVP" wrote:
>
>> No error here when running that code. What do you have checked under
>> Tools>References in the Visual Basic Editor?
>>
>> Here I have the following (some of which maybe because of other
>> macros/add-ins loaded on my system)
>>
>> Visual Basic For Applications
>> Microsoft Word 11.0 Object Library
>> OLE Automation
>> Microsoft Office 11.0 Object Library
>> Microsoft Forms 2.0 Object Library
>> Microsoft DAO 3.6 Object Library
>>
>> --
>> 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
>>
>> "Marceepoo" <36c53a08-2073470544@news.postalias> wrote in message
>> news:8AB4B3D9-D993-47D4-9FD6-46F13B846EC6@microsoft.com...
>> > The macro below works just fine...when it's located in a userform I
>> > made, in which the macro is named: Private Sub btnPath_Click()
>> > But I want to remove the macro from the userform, place the
>> > programming
>> > in the NewMacros module of the same .dot file [but with the new name:
>> > Boopsie()]), and have the Private Sub btnPath_Click macro call the
>> > boopsie
>> > macro.
>> > Unfortuntately, Boopsie doesn't work. Boopsie generates the
>> > following
>> > error message: Compile error: Can't find project or library Ok
>> > Help
>> > Does anyone have any ideas what is causing the problem, and how to
>> > fix
>> > it?
>> > Thanks, Marceepoo
>> >
>> > Here's the macro, as it appears in the NewMacros module of the same
>> > .dot
>> > file:
>> >
>> > Sub Boopsie()
>> > '
>> > ' Copy path to strVar and then to clipboard
>> > '
>> > 'frmMenuGnlAccess.Hide
>> > ActiveDocument.ActiveWindow.SetFocus
>> > Dim strFulNam As String, strPath As String
>> > Dim lLenLFileNam As Integer, lLenPthTemp As Integer
>> > Dim MyPath As DataObject
>> >
>> > Set MyPath = New DataObject
>> >
>> > strFulNam = ActiveDocument.FullName
>> >
>> > lLenPthTemp = Len(strFulNam)
>> > lLenLFileNam = InStrRev(strFulNam, "\")
>> > strPath = Left(strFulNam, lLenLFileNam)
>> >
>> >
>> > 'MsgBox strFulNam & vbCrLf & strPath
>> > MyPath.SetText strPath
>> > MyPath.PutInClipboard
>> > '
>> > End Sub
>> >
>>
>>
>>
date: Mon, 30 Jan 2006 06:14:11 +0100
author: Doug Robbins - Word MVP
|
|