Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Initiate perl script in linux from a Windows VBA program

Reply
Thread Tools

Initiate perl script in linux from a Windows VBA program

 
 
b wreath
Guest
Posts: n/a
 
      05-17-2004
Hi,

I would appreciate help with the following. I would like to be able
to initiate a perl script that is residing on a linux server from an
Excel workbook. I am working on the Excel workbook in Windows. I
would appreciate any pointers, sample code for accomplishing this in
VBA or some other method.

The perl script that I am trying to call will take the information
from the
from a mysql database and update the Excel sheet.
The script will also take information from the Excel sheet and update
the
database.

thanks very much.
 
Reply With Quote
 
 
 
 
Ben Morrow
Guest
Posts: n/a
 
      05-17-2004

Quoth (b wreath):
> I would appreciate help with the following. I would like to be able
> to initiate a perl script that is residing on a linux server from an
> Excel workbook. I am working on the Excel workbook in Windows. I
> would appreciate any pointers, sample code for accomplishing this in
> VBA or some other method.
>
> The perl script that I am trying to call will take the information from the
> from a mysql database and update the Excel sheet. The script will also take
> information from the Excel sheet and update the database.


Well, the first question here is 'what ways are there of initiating a
connection with another machine in VBA?'. Can you open sockets? Can you
make HTTP requests? XMLRPC requests? Until we know this we can't help
with the perl side.

If you can make HTTP requests, then this is probably the easiest answer.
Set up a web server on the linux box, with your perl script as a CGI,
and have the VBA perform a POST request which sends the pertinant(sp?)
data from the spreadsheet and receives the data from the database back.

If you can't make any sort of connection from within Excel, then I
reckon the best way forward is to install Perl on the windows machine as
well, and have the VBA invoke a perl script. This script can then get at
the open workbook using Win32::OLE, and communicate with the other
machine in any way reasonable: say, you have inetd listen on a given
port and invoke your perl script on the linux box, and the script on the
windows machine can then open a socket and pass the data back and forth
as needed.

You will need to design a protocol for these transactions; make sure you
think hard about it, so that it's properly extensible when you need it
to be. You will also need to think about security: how is the windows
machine going to prove to the linux machine that it is who it claims it
is, and vice versa (just as important in a case like this)? Is the data
concerned sensitive, so that you need to use SSL or whatever to encrypt
the transaction?

Modules to look at:
Win32::OLE for talking to Excel
IO::Socket::INET for opening sockets
IO::Socket::SSL for opening encrypted SSL sockets
DBI and DBD::mysql for talking to MySQL
maybe Storable, for 'freezing' perl data structures so they can be sent
to another perl process on a different machine
CGI or CGI::Lite for writing CGI scripts

Ben

--
It will be seen that the Erwhonians are a meek and long-suffering people,
easily led by the nose, and quick to offer up common sense at the shrine of
logic, when a philosopher convinces them that their institutions are not based
on the strictest morality. [Samuel Butler, paraphrased]
 
Reply With Quote
 
 
 
 
b wreath
Guest
Posts: n/a
 
      06-02-2004
Ben Morrow <> wrote in message news:<c8apvd$238$>...
> Quoth (b wreath):
> > I would appreciate help with the following. I would like to be able
> > to initiate a perl script that is residing on a linux server from an
> > Excel workbook. I am working on the Excel workbook in Windows. I
> > would appreciate any pointers, sample code for accomplishing this in
> > VBA or some other method.
> >
> > The perl script that I am trying to call will take the information from the
> > from a mysql database and update the Excel sheet. The script will also take
> > information from the Excel sheet and update the database.

>
> Well, the first question here is 'what ways are there of initiating a
> connection with another machine in VBA?'. Can you open sockets? Can you
> make HTTP requests? XMLRPC requests? Until we know this we can't help
> with the perl side.
>
> If you can make HTTP requests, then this is probably the easiest answer.
> Set up a web server on the linux box, with your perl script as a CGI,
> and have the VBA perform a POST request which sends the pertinant(sp?)
> data from the spreadsheet and receives the data from the database back.
>
> If you can't make any sort of connection from within Excel, then I
> reckon the best way forward is to install Perl on the windows machine as
> well, and have the VBA invoke a perl script. This script can then get at
> the open workbook using Win32::OLE, and communicate with the other
> machine in any way reasonable: say, you have inetd listen on a given
> port and invoke your perl script on the linux box, and the script on the
> windows machine can then open a socket and pass the data back and forth
> as needed.
>
> You will need to design a protocol for these transactions; make sure you
> think hard about it, so that it's properly extensible when you need it
> to be. You will also need to think about security: how is the windows
> machine going to prove to the linux machine that it is who it claims it
> is, and vice versa (just as important in a case like this)? Is the data
> concerned sensitive, so that you need to use SSL or whatever to encrypt
> the transaction?
>
> Modules to look at:
> Win32::OLE for talking to Excel
> IO::Socket::INET for opening sockets
> IO::Socket::SSL for opening encrypted SSL sockets
> DBI and DBD::mysql for talking to MySQL
> maybe Storable, for 'freezing' perl data structures so they can be sent
> to another perl process on a different machine
> CGI or CGI::Lite for writing CGI scripts
>
> Ben



Hi,

Thanks for the detailed response and shedding some light on problem.
I am interested in the first suggestion regarding if I am able to make
a connection from within Excel. In th section of questions listed
below.
How would I go about finding if I have this capability listed below?

Also, I would like to know where I could look up some sample code or
find
resources on the topics listed below.

thanks very much

> Well, the first question here is 'what ways are there of initiating a
> connection with another machine in VBA?'. Can you open sockets? Can you
> make HTTP requests? XMLRPC requests? Until we know this we can't help
> with the perl side.

 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      06-02-2004

Quoth (b wreath):
> Ben Morrow <> wrote in message news:<c8apvd$238$>...
> > Quoth (b wreath):
> > > I would appreciate help with the following. I would like to be able
> > > to initiate a perl script that is residing on a linux server from an
> > > Excel workbook. I am working on the Excel workbook in Windows. I
> > > would appreciate any pointers, sample code for accomplishing this in
> > > VBA or some other method.

> >
> > Well, the first question here is 'what ways are there of initiating a
> > connection with another machine in VBA?'. Can you open sockets? Can you
> > make HTTP requests? XMLRPC requests? Until we know this we can't help
> > with the perl side.

>
> How would I go about finding if I have this capability listed [above]?


Read the VBA documentation; ask in a VBA or Excel ng.

Ben

--
If you put all the prophets, | You'd have so much more reason
Mystics and saints | Than ever was born
In one room together, | Out of all of the conflicts of time.
The Levellers, 'Believers'
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl Hacker, Python Initiate Gary Chambers Python 11 02-03-2011 04:26 PM
generate dynamic client script to initiate postback + wire server event to it sonic ASP .Net 0 06-26-2006 03:59 PM
Perl to initiate and parse web search results NovasTaylor Perl Misc 1 08-16-2005 06:35 PM
Initiate PostBack From Client-side Script Jordan ASP .Net 1 07-24-2004 02:39 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments