Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hyperlink on Text in cell using phpExcel

Tags:

phpexcel

$objPHPExcel->setActiveSheetIndex($i)->getCell('A' . $j)
->getHyperlink('mytext')
->setUrl('http://abc.com');

i am trying to link a specific part of text in cell, but its linking to a whole cell, is there any solution to do it? OR if i do it with multiple cells, is there any way to apply width of specific row in a sheet? e.g.

ROW1 CELL1 CELL2 CELL3 CELL4
ROW2 ----CELL1----CELL2----
ROW3 ----CELL1----CELL2----
ROW4 ----CELL1----CELL2----

like image 964
Jabeen Avatar asked May 29 '13 12:05

Jabeen


1 Answers

Can be achieved by using below code.

$objPHPExcel->setActiveSheetIndex($i)->SetCellValue(A1, 'mytext');
$objPHPExcel->setActiveSheetIndex($i)->getCell(A1)->getHyperlink()->setUrl('http://abc.co');
like image 124
Dev001 Avatar answered Oct 08 '22 00:10

Dev001