PHPExcel - How to set a url

前端 未结 4 786
Happy的楠姐
Happy的楠姐 2021-02-04 06:53

I am isung PHPExcel and have a URL in a string. When doing:

$url = \'http://dx.doi.org/10.1016/j.phymed.2005.11.003\'
$xls = new PHPExcel();
$xls->setActiveSh         


        
4条回答
  •  一生所求
    2021-02-04 06:54

    Just lost an hour on the same issue. Finally (after checking PHPexcel source) figured out, that ->getCell('A1') is not required and allways lead me to the following error: Call to a member function getHyperlink() on a non-object. Instead you have to pass the cell-coordinates directly to getHyperlink('A1') like this:

    $YourActiveSpreadsheet->getHyperlink('A1')->setUrl($url);
    

提交回复
热议问题