Open echterhoff opened 7 years ago
Oh, by the way... Seems like Excel can't handle the combination of the probably wrong firstSheet="0" plus the veryHidden-State of the first worksheet in combination with the print document initialization. If there is no veryHidden sheet present, the document prints out of the box, just as intended.
Hi,
I have just encountered a problem I
can't really pin point.probably know the reason.Let me first explain the circumstances. I work with a "template xlsm". So I have prototyped an Excel document with some macro stuff and a tab called "_log". Die underscore character marks "private" tabs.
Now I load the template and add dynamically created sheets. At the end, before writing the file, I run through the sheets and set their states (the private-ones) to veryHidden.
Everything fine. It compiles, opens, works. But printing immediatly crashes the whole Excel application.
If I reset the state through the VBA IDE to hidden and reset it to veryHidden. I can surprisingly print it again.
I have taken a look at the xml. The first lines are from a pure PHPExcel created file.
Now here is the same part after I simply saved the file in Excel and then extracted it.
I found the property firstSheet="0" kind strange and dived into your sources, just to initialize the value to 1. Problem solved. Excel is able to print the sheet with no problems. Since you know your code the best and much more about what this initialization with 0 means, I hope it is okay if I don't take the effort to fork, fix and let you pull my changes.
Have a good one and thanks for your work and effort.
Oh, and in case you need a xls document to let excel crash on print, I can send you mine. ;-)
Lars