IDTExtensibility2

G

Geoff

We have an Excel addin that when loading Excel the
IDTExtensibility2_OnConnection loads fine. The function is below. However,
when we access another function from this DLL direct from another non Excel
application the function does not load the routine correctly. During the
process we first check if Excel is open and grab that object and if it is
not we create a new Excel instance. How do we then trigger the use of the
function below with that particular instance of Excel. What are the options
available for each variable in the function below and how do we ensure that
all other procedures connected with this procedure are loaded as well.

Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant)
end sub

Thanks in advance.
 
J

John.Greenan

Ok, so presumably when opening Excel and connecting to your add-in you do
some processing within this function

Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant)

'Your processing here.....

end sub

So, you are essentially using the subroutine parameters ByVal Application As
Object, ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant - correct?

So, why not write a new function

public function MyNewFunction(ByVal Application As Object, ByVal
ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant) as boolean

and then call that from within the IDTExtensibility2_OnConnection and from
within your code? Just pass in the correct parameters.

Does that answer you?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top