PDA

View Full Version : Access 2010 - Referencing a 3rd party interoperable provider from VBA code



Phil Cee
04-14-2015, 06:20 AM
I've been tasked with writing VBA in Access 2010 to consume web services provided by a 3rd party. Unfortunately these web services are only accessible through a .net client API & I've no idea of how to utilise this within the VBA code.
The limited documentation I've received from the 3rd party is geared entirely to ASP.net / JAVA development, although it does make a brief reference to an '...interoperable provider which provides support for COM compliant applications such as classic ASP, VB6 and VBScript...'.
As may be apparent, this is the first time I've worked with Access / VBA, so any help would be greatly appreciated.

jonh
04-14-2015, 06:35 AM
Go into any module or create a new one.
Then select tools > references > browse > and add your (.dll ?) file.

If you press F2 you should see the classes and stuff in the 'project/library' dropdown.

Phil Cee
04-14-2015, 07:23 AM
jonh: Thanks, that was the first thing I tried - selecting the .dll throws up an error: 'Can't add a reference to the specified file.'

jonh
04-14-2015, 08:01 AM
Are there any other files? .tlb?
If not I don't know. :dunno Maybe try accessing the dll direct with DECLARE and see if that works.


[Public | Private] Declare Sub name Lib "libname" [Alias "aliasname"] [([arglist])]

Phil Cee
04-17-2015, 02:45 AM
jonh: Thanks for your help, it turns out the .dlls hadn't installed properly on my dev machine. After much coffee & cursing they are now installed & can be referenced.:thumb