just as with excell, you would do this via COM. php supplies a meens to use COM, but anything within it really has nothing to do with php.
You would probably be best searching an MS developers site for the howto, then just impliment it via php and COM.