Error 451: let property not defined 
Author Message
 Error 451: let property not defined

I have a macro in excel that extracts task info using the
code below.  I had to re-install MsOffice and now I am
getting an Error 451 (Property let procedure not defined
and property get procedure did not return an object) in
the "For Each tsk" statement. ActiveProject.Tasks.Count
returns 648.  There are no "MISSING" references either.
There was one reference to this in the MS KnowledgeBase,
but it was related to the Excel Range object.

Any idea

With oMsp
  .FileOpen Name:=FullFilename, _
            OpenPool:=pjDoNotOpenPool, _
            ReadOnly:=True
  .AppMinimize
  For Each tsk In ActiveProject.Tasks
  Next tsk
End With

Jim Zeeb



Sat, 14 May 2005 02:59:50 GMT  
 Error 451: let property not defined
Not so sure about the first issue (Let Property issue).  However, as far as
you getting the Missing reference error, try using:

oMsp.ActiveProject.Tasks

In place of:

ActiveProject.Tasks

That is cause you are in an Excel Macro using references of MS Project.  VBA
uses the application object that it's in (Excel in this case given the code
sits in an Excel workbook) as the default application object, so you have to
specify the application object for when refering to an application object
outside of the application that the code resides in.

--
Ronald R Dodge, Jr
Production Statistician
Master MOUS 2000


Quote:
> I have a macro in excel that extracts task info using the
> code below.  I had to re-install MsOffice and now I am
> getting an Error 451 (Property let procedure not defined
> and property get procedure did not return an object) in
> the "For Each tsk" statement. ActiveProject.Tasks.Count
> returns 648.  There are no "MISSING" references either.
> There was one reference to this in the MS KnowledgeBase,
> but it was related to the Excel Range object.

> Any idea

> With oMsp
>   .FileOpen Name:=FullFilename, _
>             OpenPool:=pjDoNotOpenPool, _
>             ReadOnly:=True
>   .AppMinimize
>   For Each tsk In ActiveProject.Tasks
>   Next tsk
> End With

> Jim Zeeb



Mon, 16 May 2005 05:41:53 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Error 451 with tabbed control in class module

2. For each sKey in Request.QueryString returns Error 451

3. 451 Error using Collection with ActiveX control

4. 451 Error using Collection with ActiveX control

5. 451 Error using Collection with ActiveX control

6. * Quick way to define Get/Let properties

7. Compile Error: User-defined type not defined

8. Microsoft Visual Basic Compile Error: Uder-defined type not defined

9. Compile Error - User defined type not defined

10. Compile Error - User-Defined type not defined

11. User-Defined type not defined error (MAPI.Session)

12. Compile error: User-defined data type not defined!

 

 
Powered by phpBB® Forum Software