ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Creating a Windows DLL with Visual Basic
Subject:   Problem with DEF file
Date:   2006-04-11 09:54:32
From:   xfile101
Response to: Problem with DEF file

Ok, fixed that problem and others and now my DLL works great IF I use VB.exe. If I use it anywhere else, for instance excel or access, it crashes. I see other people have had this problem while others have not. I've been at this all day and really getting frustrated at this whole concept. All I want to do is use a DLL in excel and access. Can someone please point me inthe right direction? I tried to catch the error before it crashes but can't. I did manage to at least get the program not to crash by declaring the DLL in a module in excel like such:
Declare Function MyProper Lib "C:\WINDOWS\System32\ProperCase.dll" _
Alias "C:\WINDOWS\System32\ProperCase.dll MyProper@2" (ByVal var As Variant) As Variant

but if I do this I get the #VALUE error. I'm passing strings and my function takes a Variant I have chaged these to match (function takes a string)but still no luck. If someone can help I would appreciate it.