When you work with MS Excel, Word, ... and other applications, never forget that COM doesn’t know their predefined constants, thus if you want to do sth. that would look like this in VB:
With myRange.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
End With
you should either use numbers or define constants above, like this:
<?php
define('xlEdgeBottom', 9);
define('xlContinuous', 1);
define('xlThin', 2);
define('xlAutomatic', -4105);
$ex = new COM("Excel.Application", NULL, CP_UTF8) or Die ("Did not instantiate Excel");
$wb = $ex->Application->Workbooks->Add();
$ws = $wb->Worksheets(1);
$xra = $ws->Range("A1:A6");
$bs = $xra->Borders(xlEdgeBottom);
$bs->LineStyle = xlContinuous;
$bs->Weight = xlThin;
$bs->ColorIndex = xlAutomatic;
?>
It is pointless to try to use text strings, i.e.
<?php
$bs = $xra->Borders('xlEdgeBottom');
$bs->Weight = 'xlThin';
?>
this will cause an error: Unable to set property Weight of class Border ...