| Mark Durrenberger 2005-02-25, 3:56 pm |
|
> I've written an add-in for MS Project it implements idextensibility2
>
> When I launch my office application (MS Project) On connection fires
> normally.
> In the onconnection code, I launch a form in the usual manner:
frmTest.show
> (vbmodal)
> Somehow, launching this form kicks off another instance of MS Project
> With the new instance of Project, OnConnection fires again. and shows the
> form again.
> The onconnection code *only* fires twice...
>
I found this through brute force - commenting out lines ...
Turns out, the formload code called a procedure that puts a graphic on the
form. The graphic handeler needed a place (a file) to manipulate graphics so
I used "application.path" & "\" & filename .....
application.path triggered a new instance of project.
The fix, quite simple,
use the stored instance of the application (done earlier in the program)
dim AppInstance as Object
set AppInstance = Application (Application is the application object passed
to the OnConnection code)
Hope this makes sense,
Mark
|