VBA macro works in MS Word but not in MS Access 2000 (COM objects)

P

Patrik Sjögren

Hi,
We've have a DDE interface to our application, which we have
written a COM object towards to make it easier for 3rd party
providers to interface. It works fine usually, but we have recently
discovered that it is not possible to use it from MS Access using VBA.
Using VBS works fine as well as VBA macro from Word. It is normally used
from applications written in C+ and then there are no problems
whatsoever.

Are there any common mistakes that can be made in a COM object that
could make it incompatible with MS Access/VBA?

thanks/Patrik Sjögren, Sectra
 
P

Patrik Sj?gren

Additional info:

First of all, our COM object is not a GUI object. All it contains is
around 20 methods that use BSTR to send and receive information, e.g:

virtual /* [helpstring][id] */ HRESULT STDMETHODCALLTYPE
PACSGetVersion(
/* [retval][out] */ BSTR *version) = 0;

The methods in the COM object in turn calls a corresponding DDE
function of our applications to exchange information. The data
returned
through the DDE interface is correct, according to the logs. However,
when the VBA-code is run in MS Access, the returned information from
the
DDE call, in this case "PACS_version<1.4>", is replaced with "Error"
before arriving to our COM object. So, MS Access somehow corrupts the
information received via DDE to our COM object before it arrives. T
he same VBA-code works fine when run from MS Word.
The problem seems to be that MS Access somehow interferes with DDE
communication, and in our case even replaces data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top