I’m using Microsoft.Office.Interop.Excel to write data into excel cell. The cell has a certain initial height and I’m setting both “merge cell = true” and “wrap text = true”.
When the cell content is large, the cell height is not increased. I tried both of the following:
_range.entrirerow.autofit()
_range.columns.autofit()
This doesn’t work anything for me, please suggest some solution.
Try _range.Rows.Autofit();
Please note:
COM objects don’t get released with double periods. It created tempory variables, which you can’t access.
So rather use: