For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > February 2005 > Re: On Connection Help - found it









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: On Connection Help - found it
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


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com