The problem is solved. Actually, I didn't know that, in my Linux, sharable libraries are only accessible from /usr/lib.
As I was trying to access a lib in another directory, Libreoffice was not able to find it. Regards, Luciano 2015-12-11 17:15 GMT-02:00, luciano de souza <luchya...@gmail.com>: > Hello all, > > I want to use a DLL writen in Pascal to provide functions for a Excel VBA > code: > > The example code of my DLL is: > library CE; > {$mode objfpc} > > uses > Sysutils; > > function level(x1, x2: integer): integer; cdecl; export; > begin > result := x1 + 2*x2; > end; > > > exports > level name 'level'; > end. > > In VBA, I did the following code: > > > Public Declare Function dlevel Lib "CE" Alias "level" (ByVal x1 As > Integer, ByVal x2 As Integer) As Integer > > Function nivel(ByVal x1 As Integer, ByVal x2 As Integer) As Integer > nivel = dlevel(x1, x2) > End Function > > In the sheet, I did: > > =nivel(2;5) > > And I got: > #value > > I really don't know what to do. Seemlngly, VBA code is correct. I > don't know so much about DLLs, would be possible to have a mistake in > my Pascal code? > > Does someone have any idea? > > Best regards, > > > -- > Luciano de Souza > -- Luciano de Souza _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal