Executing Perl script in macro

catalyst

New Member
Joined
Mar 6, 2009
Messages
1
Hi,

I am trying to execute a perl script using ShellAndWait given here. I copied and pasted it to my VBA code. My perl script actually takes in an input. I tried several ways and the DOS window still exits right away or after the input is taken without the perl script completing its tasks.

1. retVal = ShellAndWait("C:\Perl\bin\perl.exe kloku -r", 1000000, vbNormalFocus, PromptUser)
2. retVal = ShellAndWait("C:\Klok2PTK\Data\kloku.bat", 1000000, vbNormalFocus, PromptUser)

I am able to get farther when I place it in a batch file. It actually allows the perl script to prompt me for an input. However, it still closes immediately after I placed an input.

Any help is appreciated. Thanks!
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.

Forum statistics

Threads
1,222,398
Messages
6,165,767
Members
451,986
Latest member
samwize

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top