Connect to Unix and execute perl script from VBA

aseem.singhal

New Member
Joined
Aug 25, 2009
Messages
2
Hi,

I would like to connect to Unix server and execute a perl script there from Excel VBA. Can you please give an example of this.

Thanks,
Aseem

EDIT: <!-- / icon and title --> <!-- message --> Oh and I am using Excel 2007. I think that will make a difference finding the different libraries. Thanks
 
Last edited by a moderator:

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
This topic comes up rarely and usually goes unanswered (except for ftp questions). You might prefer to ask in a Linux forum.

As far as I know, you would need to do two things - first connect to the linux machine in question, second, execute the script. The first might be done through an ssh connection, and the second is easy enough, assuming you have permissions on the file. This is really a networking thing, and as far as I know vba as such will not give you the tools, but you can access a DOS shell via VBA (try searching under VBA Shell or VBA ShellExecute) and run commands via the windows command line.

Alex
 
Upvote 0
Upvote 0
Hi Alexander,
Unfortunetly I dont have administrative rights on my computer. Also, I was expecting a simpler way like a winsock because I believe connecting to unix was easier with Excel 2003. Is there any work around? Maybe i can download the wonsock library, etc?
Thanks
Aseem
 
Upvote 0
It maybe that telnet is possible, but frankly - that's not secure at all. I'm not expert enough to give advice, and really don't know a thing about winsocks. Are you simply trying to connect to a unix machine and say "run this script"? Problem with telnet is that your password is plain text - the whole world will see it. Same for ftp, btw. Is the unix machine local to your lan? Or do you intend to use the internet to connect to it?

Alex
 
Last edited:
Upvote 0
I've reached the end of my expertise but this link shows some sample code:
linux questions - winsock to unix

It seems to me you'd need to create a listening socket on the unix side, and send a message to it from a sending socket on the windows side. It doesn't seem extremely difficult (a little knowledge of C helps) - but that said, there's a lot more to this than just opening a port to listen for traffic. I'm seeing nothing about these messages being encrypted, or the dangers of opening ports. My advice is that if you can't use ssh (puTTY) or another form of secure connection, don't do this (unless you really know exactly what you are up to).

Alex
 
Upvote 0

Forum statistics

Threads
1,215,042
Messages
6,122,810
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