I am trying to connect to MQ Series Queue using VBA and using the below code which I found somewhere on the net. When I run it, I get a 'Active X component can't create object' error.

Dim Session As MQSession
Dim QueueManager As MQQueueManager
Dim Queue As MQQueue

Set Session = New MQSession
Set QueueManager = New MQQueueManager


Set Queue = QueueManager.AccessQueue("QueueName", MQOO_OUTPUT)

while running this code, when it gets to Set Session = New MQSession, i get the 'Active X component can't create object' error.

I have created a reference to MQAX200.dll to use the MQ. My requirement is to push some stuff onto the queue.

Any help would be appreciated.

Thank you.