G
Gaby
Hello everybody:
I´m developing some macros in project professional 2003 for a specific
requirement. I need that custom durations enterprise date 1 and enterprise
date 2 draw in gantt chart like task bars. So I was developing this macros.
On my developer environment all works fine, but when I test in production
environment I get some errors. In many PC´s when I open Project Professional
2003 and this load Enterprise Global Template, appears an error runtime 424:
object required in this line (***): Set y.proj=Application.ActiveProject. The
error says that a Project object is required:
Option Explicit
Dim Y as NEW EventClassModule
Sub Initialize_App()
Set y.app=MSProject.Application
(***) Set y.proj= Application.ActiveProject
End sub
This code is in a module names MyModule in Enterprise Global Template
I don´t understand why this error appears in some PC´s and in another PC´s
doesn´t appear. In a forum I read that maybe the error is that I declare
variable Y like Dim, so I change this line by:
Public Y As New EventClassModule
but the error still appears when I open Project Professional 2003 with a
Windows Account.
In EventClassModule class module I write this code:
Option Explicit
Option Base 1
Public With Events App As Application
Public With Events Proj As Project
Private Sub App_ProjectBeforeTaskChange(Byval tsk As MSProject.Task, Byval
Field As PjField, ByVal NewVal as Variant, Cancel As Boolean)
If (Field= PjTaskEnterpriseDate1) Or (Field=PjTaskEnterpriseDate2)
tsk.EnterpriseFlag2=1
End If
Private Sub App_ProjectTaskNew(Byva pj As Project , ByVal ID As Long)
For each tarea in ActiveSelection.Tasks
tarea.EnterpriseNumber5= 0
tarea.EnterpriseNumber6= 0
Next tarea
In ThisProject in Enterprise Global Template I write this code
Private Sub Project Open(Byval Pj as Project)
Call Initialize_App
End Sub
I have another module in Enterprise Global Template, that copy
EnterpriseDate1 to Start1 and EnterpriseDate2 to Finish 1, and this code is
active whit a buttom in a toolbar.
Could you help me, please? Why appears this error in some PC´s. I´m
desperate about this error. I´m new in developing macros and maybe I´m not
doing a good procedure. Could you help me????
Please, Help me!!!
Thanks in advance.
Gaby.
I´m developing some macros in project professional 2003 for a specific
requirement. I need that custom durations enterprise date 1 and enterprise
date 2 draw in gantt chart like task bars. So I was developing this macros.
On my developer environment all works fine, but when I test in production
environment I get some errors. In many PC´s when I open Project Professional
2003 and this load Enterprise Global Template, appears an error runtime 424:
object required in this line (***): Set y.proj=Application.ActiveProject. The
error says that a Project object is required:
Option Explicit
Dim Y as NEW EventClassModule
Sub Initialize_App()
Set y.app=MSProject.Application
(***) Set y.proj= Application.ActiveProject
End sub
This code is in a module names MyModule in Enterprise Global Template
I don´t understand why this error appears in some PC´s and in another PC´s
doesn´t appear. In a forum I read that maybe the error is that I declare
variable Y like Dim, so I change this line by:
Public Y As New EventClassModule
but the error still appears when I open Project Professional 2003 with a
Windows Account.
In EventClassModule class module I write this code:
Option Explicit
Option Base 1
Public With Events App As Application
Public With Events Proj As Project
Private Sub App_ProjectBeforeTaskChange(Byval tsk As MSProject.Task, Byval
Field As PjField, ByVal NewVal as Variant, Cancel As Boolean)
If (Field= PjTaskEnterpriseDate1) Or (Field=PjTaskEnterpriseDate2)
tsk.EnterpriseFlag2=1
End If
Private Sub App_ProjectTaskNew(Byva pj As Project , ByVal ID As Long)
For each tarea in ActiveSelection.Tasks
tarea.EnterpriseNumber5= 0
tarea.EnterpriseNumber6= 0
Next tarea
In ThisProject in Enterprise Global Template I write this code
Private Sub Project Open(Byval Pj as Project)
Call Initialize_App
End Sub
I have another module in Enterprise Global Template, that copy
EnterpriseDate1 to Start1 and EnterpriseDate2 to Finish 1, and this code is
active whit a buttom in a toolbar.
Could you help me, please? Why appears this error in some PC´s. I´m
desperate about this error. I´m new in developing macros and maybe I´m not
doing a good procedure. Could you help me????
Please, Help me!!!
Thanks in advance.
Gaby.