Search This Blog

Showing posts with label link. Show all posts
Showing posts with label link. Show all posts

Monday, May 7, 2012

COM interop an interesting link


Here you can find an interesting link about COM interop

http://limbioliong.wordpress.com/2011/10/28/exposing-an-enumerator-from-managed-code-to-com/

This is one of his most important tips

The interface type should be either :

ComInterfaceType.InterfaceIsDual
or ComInterfaceType.InterfaceIsIDispatch
otherwise the GetEnumerator() method
will not be marked with dispid -4.
Without this dispid, this method
will not be recognized by COM as
returning an enumerator. It will not thus
not be usable in a VB6.0 For Each Next
statement.

Wednesday, January 4, 2012

Matlab Excel Link from VBA configuration

To create macros that use Excel Link functions, you must first configure Excel to reference the functions from the Excel Link add-in. From the Visual Basic environment pull down the Insert menu and select Module.When the Module page opens, pull down the Tools menu and select References.... In the References window, check the box for EXCLLINK.XLA and click OK. You may have to use Browse to find the EXCLLINK.XLA file.

If you use MLGetMatrix in a macro subroutine, enter MatlabRequest on the line after MLGetMatrix. MatlabRequest initializes internal Excel Link variables and enables MLGetMatrix to function in a subroutine. For example,

Sub Get_RangeA()
  MLGetMatrix "A", "RangeA"
  MatlabRequest

End Sub

Do not include MatlabRequest in a macro function unless the function is called from a subroutine.