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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,215,039
Messages
6,122,802
Members
449,095
Latest member
m_smith_solihull

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