VB Editor complains of undefined variable for VBE
- From: "Alan Glaister" <AlanGlaister@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 6 May 2005 11:12:02 -0700
I have a project that uses an add in to deliver most of the functionality.
This included a proprietary save in which I store data on the *** for the
next time.
A request was made to be able to "minimise" the form to look at the ***. I
put this in but this then exposed a method by which the user can save using
excels save not using the forms methods that store vital data before the user
exits.
To catch this I need to put a workbook_beforesave() event in to the
work*** itself to call a function in the addin to do the stores as if the
user had used the form save.
I have used code from http://www.cpearson.com/excel/vbe.htm but when I
compile/run I get variable not defined errors on the "vbext_pk_Proc"
Function ProcedureExists(ProcedureName As String, ModuleName As String) As
Boolean
On Error Resume Next
If ModuleExists(ModuleName) = True Then
ProcedureExists = ThisWorkbook.VBProject.VBComponents(ModuleName) _
.CodeModule.ProcStartLine(ProcedureName, vbext_pk_Proc) <> 0
End If
End Function
I tried Dim vbext_pk_Proc as ProcKind, but then I just got a user defined
type error
Looking in my object browser I don't seem to have the vbext_<> set of
declarations but I can't figure how to reference it.
Help!!!
.
- Follow-Ups:
- Re: VB Editor complains of undefined variable for VBE
- From: Tom Ogilvy
- RE: VB Editor complains of undefined variable for VBE
- From: Jim Thomlinson
- Re: VB Editor complains of undefined variable for VBE
- Prev by Date: RE: Recalculating single cell
- Next by Date: Re: Userform
- Previous by thread: Excel already open test
- Next by thread: RE: VB Editor complains of undefined variable for VBE
- Index(es):