-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push buttons are not preserved when loading and saving a file. #3147
Comments
This is probably solved by PR #3130. Please test with it if you can. It is still in draft status, but I think I am getting close to readying it. |
I temporarily exchanged my installation with the code of your PR. Unfortunately it is not fixing it. :-( |
Sorry, there are many aspects of ods which are currently unimplemented in PhpSpreadsheet, and this is one of them. My PR applies only to Excel xlsx/xlsxm files. |
Ah, I tried with an xls file too. To be exact I opened an xls file and saved as xlsx. |
You may be out of luck, then. My PR won't handle xls either. I did try an online converter on your sample file - it didn't work, which isn't terribly surprising. |
LibreOffice 7.3.6.2 allowed me to save your ods worksheet as xlsx (not xlsm). When I open that xlsx file, the button is there, and you can click it, but Excel will say it can't find the macros, which is reasonable. I am happy to report that loading and saving that file using my PR does create a good copy (still has the button, you can still push it, but ...). So perhaps you can do the same and manually add the macros. I don't know if that's good enough for you, but it's probably as far as I can go for now. |
I also have a spreadsheet which, opening and saving with PHPSpreadsheet, is clearing the buttons. |
This is:
I'm working on an old club project which used to utilize PhpExcel... Now I got hands on because there was something to do and I recognized some errors which I think were causes by an update of the PHP version from the pages provider side.
I got things running with PhpSpreadsheet thanks to a good documentation and most of the things are running fine again but...
The project needs to alter some data of an old Excel spreadsheet file which contains some buttons which are running VBA scripts. Unfortunately the buttons are gone after altering some cells an saving the file back to disc.
I'm not sure if this is related to #2904.
To demonstrate the behaviour I coded a MCVE which you can checkout at: https://www.moellner-rc.com/ls_bugdemo/
I'm happy to help with further information about the issue.
What is the expected behaviour?
Push Button is still there after altering the document as it was when using the outdated PHPExcel (v1.8.1)
What is the current behaviour?
The push button has disappeared (*.xls and .ods) and the Basic-Script code has disappeared as well (.ods only).
What are the steps to reproduce?
https://www.moellner-rc.com/ls_bugdemo/
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
If this is an issue with reading a specific spreadsheet file, then it may be appropriate to provide a sample file that demonstrates the problem; but please keep it as small as possible, and sanitize any confidential information before uploading.
What features do you think are causing the issue
I'm pretty unsure. :-/
Does an issue affect all spreadsheet file formats? If not, which formats are affected?
I doubt yes.
Which versions of PhpSpreadsheet and PHP are affected?
1.25.1
The text was updated successfully, but these errors were encountered: