Problem solve Get help with specific problems with your technologies, process and projects.

Calling AS/400 programs from Excel spreadsheets

If any of you are downloading AS/400 files into Excel using macros, you probably have the users going to the green...

screen to run an update or refresh program, then going into Excel to actually download the spreadsheet.� If you create a macro with the following four lines of code in it, the spreadsheet can run the refresh program on the AS/400 for the user and they need not go to the green screen.

The called program runs under QUSER, as most External Jobs do, but you can find the job by looking at the Job Threads of QUSER jobs. If the program has a message, it will need to be answered by the System Operator, as is the case with any Batch Job.

Code:

Set cn400 = CreateObject("ADODB.Connection") 

cn400.Open "Provider=IBMDA400;Data Source=(system name);", "", "" 

TempCommand = "{{CALL /QSYS.LIB/(library name).LIB/(program name).PGM}}" 

cn400.Execute TempCommand


 

This was last published in January 2001

Dig Deeper on RPG iSeries programming

Join the conversation

1 comment

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

I insert four line to call my CL program, is works for the first time; but now is no longer work. 

Can you tell me why ? thanks
Cancel

-ADS BY GOOGLE

SearchEnterpriseLinux

SearchDataCenter

Close