Excel File Size Growth Due to Row Hiding #2060
-
When I don't use the SetRowVisible method, my Excel file remains small, around 7KB. However, here's the code I'm using: func hideRows(f *excelize.File, sheet string, startRow int) error {
for row := startRow; row <= 1048576; row++ { // Max rows in Excel
if err := f.SetRowVisible(sheet, row, false); err != nil {
return fmt.Errorf("failed to hide row %d: %w", row, err)
}
}
return nil
} If I apply SetRowVisible to hide all rows from 22 downwards, the size of the Excel file (xlsx) increases dramatically to about 2.5MB. Is there a way to avoid this significant increase in file size? |
Beta Was this translation helpful? Give feedback.
Answered by
SinghNanak
Jul 2, 2025
Replies: 1 comment
-
I use following approach
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
aphsa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use following approach