Get range Width

Mar 25, 2010 at 10:13 AM

$sheetobj->getColumnDimension("C1")->getWidth();

Now,I try get the    

$sheetobj->getColumnDimension("C1:F9")->getWidth();

ERROR!    How do I do?

 

  public function getCreated()  
  public function setCreated($pValue = null)  
  public function getModified()  
  public function setModified($pValue = null)   
  public function getTitle()  
  public function setTitle($pValue = '')  
  public function getDescription()   

EXCELVBA:

With ActiveCell.Characters(Start:=1, Length:=11).Font
        .Name = "Arial"
        .FontStyle = "常规"
        .Size = 10
        .Strikethrough = False
        .Superscript = False
        .Subscript = False
        .OutlineFont = False
        .Shadow = False
        .Underline = xlUnderlineStyleNone
        .ColorIndex = xlAutomatic
    End With

How do I do in PHPEXCEL?

Developer
Mar 26, 2010 at 3:14 AM

1)

 

// width of column C
$width = $sheetobj->getColumnDimension('C')->getWidth();

// total width C~F
$width = 0;
for ($i = 2; $i <= 5; $i++) {
    $width += $sheetobj->getColumnDimensionByColumn($i)->getWidth();
}

2)

Have you looked into the section about Rich-Text in the PHPExcel developer documentation?