P
Pradeep Mishra
Hi,
While Working with an add-in written for Microsoft Project 2000 SP-1,
i came across a strange behaviour of COM plug-in written for MSProject
in Visual Basic 6.0.
If i write code in ProjectBeforeTaskChange() event of MSProject then
Pasting an Icon(Just an Icon and nothing else) in Notes Field of a
task throws an runtime Error.
This can be reproduced through following steps.
1. Open Visual Basic, New Add-in Prject
2. Open Connect.dsr
3. Select Application "Microsoft Project"
4. Choose Application Version "Microsoft Project 9.0"
5. Initial Load Behavior "Startup"
6. open Code Window
7. Delete all Pre-Written code
8. Paste the following code in Connect.dsr
'--------------------------------------------------------------------
Option Explicit
Public WithEvents MSProjectApp As MSProject.Application
Private Sub AddinInstance_OnConnection(ByVal Application As
Object,ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode,
ByVal AddInInst As Object, custom() As Variant)
Set MSProjectApp = Application
End Sub
Private Sub MSProjectApp_ProjectBeforeTaskChange(ByVal tsk As
MSProject.Task, ByVal Field As MSProject.PjField, ByVal NewVal As
Variant, Cancel As Boolean)
MsgBox "Before Task Change"
End Sub
'--------------------------------------------------------------------
9. Compile the Code.
10. Open MSProject
11. Create a new project
12. Enter Task Name
13. Right click on a toolbar and Select Customize.
14. Right click on a button with image i.e. Save on main tool bar.
15. Press Copy Button Image
16. Close the customize box
17. Double click on task this will open Task Information Dialog.
18. goto last tab on the dialogbox which is named "Notes"
19 Rightclick on the Notes RTF Editor provided and press paste. Don'
type anything else.
20 Press OK Button.
Runtime Error occurs
Runtime Error '485':
Variable Uses an Automation type not supported in Visual Basic
Can any give a workaround so that this error does not occur.
Best Regards,
Pradeep Mishra
While Working with an add-in written for Microsoft Project 2000 SP-1,
i came across a strange behaviour of COM plug-in written for MSProject
in Visual Basic 6.0.
If i write code in ProjectBeforeTaskChange() event of MSProject then
Pasting an Icon(Just an Icon and nothing else) in Notes Field of a
task throws an runtime Error.
This can be reproduced through following steps.
1. Open Visual Basic, New Add-in Prject
2. Open Connect.dsr
3. Select Application "Microsoft Project"
4. Choose Application Version "Microsoft Project 9.0"
5. Initial Load Behavior "Startup"
6. open Code Window
7. Delete all Pre-Written code
8. Paste the following code in Connect.dsr
'--------------------------------------------------------------------
Option Explicit
Public WithEvents MSProjectApp As MSProject.Application
Private Sub AddinInstance_OnConnection(ByVal Application As
Object,ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode,
ByVal AddInInst As Object, custom() As Variant)
Set MSProjectApp = Application
End Sub
Private Sub MSProjectApp_ProjectBeforeTaskChange(ByVal tsk As
MSProject.Task, ByVal Field As MSProject.PjField, ByVal NewVal As
Variant, Cancel As Boolean)
MsgBox "Before Task Change"
End Sub
'--------------------------------------------------------------------
9. Compile the Code.
10. Open MSProject
11. Create a new project
12. Enter Task Name
13. Right click on a toolbar and Select Customize.
14. Right click on a button with image i.e. Save on main tool bar.
15. Press Copy Button Image
16. Close the customize box
17. Double click on task this will open Task Information Dialog.
18. goto last tab on the dialogbox which is named "Notes"
19 Rightclick on the Notes RTF Editor provided and press paste. Don'
type anything else.
20 Press OK Button.
Runtime Error occurs
Runtime Error '485':
Variable Uses an Automation type not supported in Visual Basic
Can any give a workaround so that this error does not occur.
Best Regards,
Pradeep Mishra