Page 1 of 1

How to run Excel VBA by PHP

Posted: Thu Sep 11, 2008 2:35 am
by mainicia
I have some utillity that written on excel and using VBA
Anyway, how can I call that procedure on PHP client side such as...

client ---> php ---> server ---> vba on excel ---> php ---> client

anybody know how to do that? :?:

Re: How to run Excel VBA by PHP

Posted: Thu Sep 11, 2008 7:48 am
by ddragas
I don't think this is possible and php is server side, not client side

Re: How to run Excel VBA by PHP

Posted: Sun Sep 14, 2008 10:30 pm
by mainicia
I have to run VBA on my website. anyone have solution?

Re: How to run Excel VBA by PHP

Posted: Mon Sep 15, 2008 12:22 am
by alex.barylski
While it's technically possible...it's easier to accept defeat and find an alternative solution. Why do you need to run VBA under PHP?

Is the server Windows powered? Then you could maybe write an extension wrapper around the VBA DLL's and pass VB code to the PHP extension function for execution. Any VBA interpretor would work but that is a massive complex task for anyone, nevermind someone who is asking how this would be done.

Re: How to run Excel VBA by PHP

Posted: Mon Sep 15, 2008 1:37 am
by mainicia
I have some calculation function on VBA of excel.
I can't rewrite in php script because it need some specific function on excel.

so there's more condition is that excel must can be run on web application too.

that's why I need some code to run VBA in excel on my web server station.

Re: How to run Excel VBA by PHP

Posted: Mon Sep 15, 2008 2:44 am
by onion2k
PHP can connect to Excel using COM, so you should be able to use that. You'll need to be using a Windows server, and it'll need to have Excel installed on it (or maybe just Excel Viewer..). Unfortunately it's the sort of thing that noone ever really does because most people who need this sort of functionality build their websites in .NET, so I imagine you'll need to work out exactly how to do on your own.

http://sydphp.org/presentations/010606-excel.html - Page 7 gives you a basic example.

http://msdn.microsoft.com/en-us/library ... e.11).aspx is the documentation for the Excel application object.