I want to modify an already existing excel sheet with delete the formula used in the sheets using PHP.
I tried to use php Spreadsheet. Not able to delete the formula used the excel sheets
Is there some way I can modify the already existing excel sheet with removing the formula using PHP?
Related
I want to modify an already existing excel sheet with delete the formula without affecting the values in the cell which are generated by those formula used in the sheets using PHP.
I tried to use php Spreadsheet. Not able to delete the formula used the excel sheets
Is there some way I can modify the already existing excel sheet with removing the formula using PHP?
I have a TBS Excel template with numerous sheets. I want to rename each sheet to match a variable that is going to be put into cell A2. I know Excel will not allow special characters in table names, so I can not use a square brackets to set a TBS variable.
Is there a way to change the sheet names programatically either using TinyButStrong Excel or PHP (note: PHP Excel is not an option in this environment)?
Thank you
For now (OpenTBS version 1.9.11) there is no special feature for renaming a sheet in an XLSX workbook.
Nevertheless, you can open the sub-file 'xl/workbook.xml' and replace the the old sheet name by the new one knowing that the sheet name is stored in a name attribute.
XSLX example:
<sheet name="My old sheet" sheetId="1" r:id="rId1"/>
PHP code:
$TBS->PlugIn(OPENTBS_SELECT_FILE, 'xl/workbook.xml');
$TBS->Source = str_replace('name="My old sheet"', 'name="My new sheet"', $TBS->Source);
I am currently facing one issue. I have an excel sheet with some particular formatting. I have to make a program which can read the data from the sheet and analyze it from my database, fetch some more data and write back to the same sheet.
I know how to read and write using PHPExcel. But I don't know how to write on a given sheet.
At the moment of this writing the current version of PHPExcel is version 1.8.0. I know how to make a chart and embed it in a worksheet, I basically followed the provided example.
Excel allows to either embed a chart into a worksheet or otherwise make a chart sheet. A chart sheet has it's own 'tab' in Excel and Excel keeps the chart scaled to the available size in the window.
Now what I would like to know is: how to add a chart sheet with PHPExcel? Is this possible with PHPExcel 1.8.0 using the 'Excel2007' writer?
As stated by #MarkBaker in the comments, the answer is simply "No" (at least not in version 1.8.1).
In my use case I was using PHP to generate an Excel workbook based on some processed data from different sources. What I did is to add VBA in Sub Workbook_Open() on the generated workbook to move the chart from a worksheet to it's own chart sheet. Then I used PHPExcel->getMacrosCode() to export the binary string of macro code to some file.
Now when generating files I add that binary string with PHPExcel->getMacrosCode(String) and save it as .xlsm instead of .xlsx. It is a bit of a hassle, but this is how I work around this problem for me.
Note that depending on your use case you might also need to generate a certificate to sign the code, to allow your user to always trust macros.
I am trying to export excel file from the mysql as per the answer in
Exporting data to excel sheet in php. The export is successful. But I would like to know about the styles. Can I make one line bold, italic etc in the excel file? And can I insert a table using this excel export?
Thanks!
https://www.google.com/search?q=php+excel+styling
yeilds:
PHPExcel: Coloring the cells?
PHPExcel specific cell formatting from style object
PHPExcel style problem
PHP Excel style formatting using col & row index
Style a range of cells with phpexcel
PHPexcel cannot reads styles from xls
SO is endless with information, and that's just the first page of results