Hi,
I'm starting a project to integrate a third party add-in from SagePay to our in-house Access database and unsure on some of the basics. I've completed the following steps but not clear on where the initial problem lies. Any assistance appreciated..
1. Discovered that I need a type library (tlb file) for the dll so I generated file using regasm (have .net framework 4.5 installed which is a listed minimum requirement)
(regasm.exe in c:\windows\microsoft.net\f
ramework\v
4.0.30319 = v4.5 folder after upgrade by all accounts)
regasm c:\sagepay\guardian\bin\Integral.Library.GuardianClient.dll /tlb
2. Added a reference to the add-in to vba project
![VBA reference to SagePay dll]()
3. Declared function call for the add-in using documentation:
Public Declare Function Process Lib "c:\sagepay\guardian\bin" ( _
ByVal transactionType As TRANSACTIONHOOK_TRANSACTIONTYPE, _
ByVal transactionAmount As Integer, _
ByRef tillInfo As TillInformation, _
ByRef transInfo As TransactionInfo) _
As Boolean
4. This is where my knowledge gets a bit sketchy; I assumed the add-in would include the tillinformation type definition which I checked in the object browser but this is not the case as it shows no members?
![VBA object view of TillInformation class]()
Hence, declared a VBA type as shown to match the documentation although documentation does not specify actual data types. I've tried varying strings / integers for some of the type declarations with no effect.
Public Type TillInformation
merchantname As String
address1 As String
address2 As String
address3 As String
address4 As String
phonenumber As String
sitenumber As String
tillnumber As String
receiptnumber As String
operatorid As String
End Type
5. Now when I try to call the function fro a test form, I get a type mismatch with 'tillinformation' parameter so it’s obviously not happy with the declaration..
![Runtime / compile error with Process function]()
I don't know if the issue is with the add-in registration or the way I'm trying to declare the necessary types etc. so desperately in need of some guidance please! Thanks
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.