DeleteSheet parses XML #1336
thomascharbonnel
started this conversation in
Ideas
Replies: 3 comments 1 reply
-
The excelize will check and adjust the active sheet after deleting the sheet, if the active sheet index has not been updated, may be caused to generate a workbook corrupt, so I think we need to keep this step. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Right, i think this step is needed for the regular writer but not streamwriter? |
Beta Was this translation helpful? Give feedback.
0 replies
-
NVM, my method creates corrupted Excel files, bad idea! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I was profiling my Go program based on Excelize and noticed a possible performance improvement in a tiny edge case situation.
I'm using an Excel file as my input template and i go through each sheet and write an updated sheet to a copy of the input. I'm using StreamWriter when writing to that copy, the updated copy then becomes my output.
I'm reusing the input Workbook because it's simpler this way to copy Workbook-level attributes.
I've noticed that when opening an existing sheet with NewStreamWriter, the XML is parsed, so i've decided to delete the sheet beforehand (so that there is no XML to parse). The issue is when calling
DeleteSheet
, the last step will also read the XML (see here).I wondered if it would be okay to create another method such as
DeleteSheetWithoutActiveSheet
as, if i'm not mistaken, updating the active sheet isn't important when using StreamWriter.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions