+ Reply to Thread
Results 1 to 2 of 2

Passing Strucutres from VBA to DLL and back

  1. #1
    mikeduk
    Guest

    Passing Strucutres from VBA to DLL and back

    Hi,

    I need to pass a matrix type data structure between Excel VBA and an
    external DLL (XLL actually).

    Because of the bug in Excel, where a call to
    Application.Evaluate("MyXLLFunction()") will actually call my proc twice, I
    want to be able to declare the external method in VBA and call it, without
    using Evaluate.

    This is easy enough with simple types, but I want to be able to return a
    more complex data type back and forth, one similar to the Excel SDK's Multi
    type, where you can return multiple rows of multiple columns.

    Does anyone know the best way of doing this?

    Thanks

    Mike Davies


  2. #2
    Peter T
    Guest

    Re: Passing Strucutres from VBA to DLL and back

    Hi Mike,

    I can't answer your question but as it's been around a while perhaps clarify
    the following for others to consider -

    What's the Excel bug that results in your proc being called twice. Is this a
    "known issue" or due different parts of some formula requiring the same
    function.

    Could you illustrate your complex data type. Though from what you describe
    it sounds like a normal Range object.

    Regards,
    Peter T

    "mikeduk" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    >
    > I need to pass a matrix type data structure between Excel VBA and an
    > external DLL (XLL actually).
    >
    > Because of the bug in Excel, where a call to
    > Application.Evaluate("MyXLLFunction()") will actually call my proc twice,

    I
    > want to be able to declare the external method in VBA and call it, without
    > using Evaluate.
    >
    > This is easy enough with simple types, but I want to be able to return a
    > more complex data type back and forth, one similar to the Excel SDK's

    Multi
    > type, where you can return multiple rows of multiple columns.
    >
    > Does anyone know the best way of doing this?
    >
    > Thanks
    >
    > Mike Davies
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1