Solved

Connecting to a MQ Series queue via VBA (Excel Spreadsheet)

Posted on 2004-10-01
3
2,533 Views
Last Modified: 2016-09-25
Anyone have any examples of this being done....it's a shot in the dark but why not.
0
Comment
Question by:greedy1
3 Comments
 
LVL 3

Accepted Solution

by:
KeithWatson earned 100 total points
ID: 12213236
Why not indeed...

You will need to reference the MQAX200.dll in Tools->References

This code assumes the queue manager lives on the same machine, or you have the MQ Client software with appropriate configuration. If not, you'll need to set IP number/port and channel information.

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

Set Session = New MQSession
Set QueueManager = New MQQueueManager

QueueManager.Name="QueueManagerName"
QueueManager.Connect

Set Queue = QueueManager.AccessQueue(“QueueName”, MQOO_OUTPUT)


There is more detail provided in the IBM redbook at:

http://www.redbooks.ibm.com/redbooks/pdfs/sg246506.pdf

Hope that helps,

Keith.
0
 

Author Comment

by:greedy1
ID: 12217421
Awesome...I even made it to the redbook, but didn't clue in on the Active X part, haven't tried it yet but it should be ok.  thanks again.
0
 

Expert Comment

by:Chirag Shrimali
ID: 41814417
Guyz, thanks for the sample code, can you highlight how to use the above code if mq in installed on different. Have browsed net for few days, however unable to make out how to define channel, host and port definations. Any help will be appriciated
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now