Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
It sounds like you're trying to do this the complicated way. Is there a good reason the perl script is running on a linux machine, updating your Excel, presumably on the Windows machine, or a shared drive? Did you know there are versions of Perl for Windows? Go look at http://www.activestate.com for one.

Also, I would suggest just using Perl for all of it, depending on what the rest of the VBA code is doing.

Anyhow. Calling perl installed on the Windows machine is realtively easy, use the VBA 'Shell' function to run the executable, and pass it whichever parameters you want with the script name. Calling perl on a remote machine involves knowing how you would do it by hand. You can either install it as a CGI, and use the HTTP VB objects to simulate surfing there. Or you attempt to run the perl executable 'by hand', by logging in remotely, with telnet for example. (VB might have a control for that, or you'll need the socket control).

You could also Shell out to plink.exe (part of the putty suite of ssh tools) and run a remote command that way. docs

Other than that, its hard to give advice.. To programmatically do something like this, you first have to know how you would do it by hand..

C.


In reply to Re: Initiate perl script in linux from a Windows VBA program by castaway
in thread Initiate perl script in linux from a Windows VBA program by bwreath

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-04-19 10:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found