Why not try to execute the macro,

$Excel->application->run("book.xls!macro");

but if this is not possible / desirable, the with statement: 

   With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
   End With

is only a shorthand way of specifying

   Selection.Borders(xlEdgeBottom).LineStyle = xlContinuous
   Selection.Borders(xlEdgeBottom).Weight = xlThin
   Selection.Borders(xlEdgeBottom).ColorIndex = xlAutomatic

Hope this helps,
Regards,
Neil Morgan

-----Original Message-----
From: Ethan Nelson [mailto:[EMAIL PROTECTED]
Sent: 28 October 2003 22:13
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Help with COM


Hello,

I am trying to write some excel functions in PHP 4.3.3 using the COM
interface.  The objective it to create a "BottomEdge" border with regular
line styles etc...  The actual visual basic code that the macro recorder in
excel writes goes as follows:

Range("A13:E13").Select
   Selection.Borders(xlDiagonalDown).LineStyle = xlNone
   With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = xlAutomatic
    End With

Now my code is in object and looks something like:

$this->sheet->column->EntireColumn->Font->Bold=true;

That would be an example of how I would make an entire column bold (I
think).  Anyway... how the heck do I do a "with" statement using this PHP
syntax?  I tried separating each line into objects but tells me it can't
find function "Border":

$range = $this->sheet->Range("A13:E13");
$selection = $range->Select;
$diagdown = $selection->Borders(xlDiagonalDown);
$diagdown->LineStyle = xlNone;

...

with?

Thanks for the help... I'm pretty new at trying to translate VB syntax into
a compatible PHP code.

-Ethan Nelson,

Modulus, LLC

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to