Consulting

Results 1 to 2 of 2

Thread: EXCEL, VBA, DLL

  1. #1
    VBAX Newbie
    Joined
    Nov 2015
    Posts
    1
    Location

    EXCEL, VBA, DLL

    Hallo,

    I have some 32-bit-DLLs with complicated functions, which I use in an Excel-Spreadsheet. For this, I made a macro (VBA), which defines a function for the spreadsheet (user defined function) and this macro does not more than to calls the function in the DLL. Works fine.

    Now I have to adapt it to 64-bit-systems. I decided, to use C++ and Visual Studio 2015 to make the DLL. (My original Pascal-Compiler does not support 64 bit and a change to C++ was very simple, there are only mathematical operations). I have read a lot, read posts in forums, tried a lot... no success. The macro runs, but I get "#WERT!" (I assume, in English versions "#VALUE!") in the cell. The problem seems to be in the fields "byval, byref", "stdcall, cdecl", "4- or 8-bit alignment" or any other of this kind.

    Does anybody have an example which works? Any function "MyAdd(a1,a1 as double)" giving a1+a2 as result?

    Would be great,
    GaAck

    Note: The algorithms are also used and tested (!!) in other programs, otherwise I could do it simply in an Excel-Makro.

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    Welcome to the forum!

    I have not made a 64bit DLL. If you want to try my 32bit simple example made in vb.net,see: http://www.vbaexpress.com/forum/show...hlight=mathlib

Posting Permissions

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