Well, sure, if I remove these lines of code, still it works fine and the auto-fit operation is applied accordingly. See the updated sample code and please find attached the output file here.
//Create Workbook Object
Workbook wb = new Workbook();
//Open first Worksheet in the workbook
Worksheet ws = wb.Worksheets;
//Get Worksheet Cells Collection
Aspose.Cells.Cells cell = ws.Cells;
//Add Text to the First Cell
cell[0, 0].PutValue(“I am using the latest version of Aspose.Cells to test this functionality”);
//Make Cell’s Text wrap
Style style = cell[0, 0].GetStyle();
style.IsTextWrapped = true;
// Save Excel File
Note: if you are applying auto-fit operation on merged cells, I am afraid, it will not work as MS Excel too does not auto-fit rows on merged cells area. You may confirm it in MS Excel.
If you have different issue and MS Excel can work fine but Aspose.Cells does not work, please create a sample application to show the issue by attaching it here (zip the archive), we will check it soon.
Also attach your template file and output file. Moreover, attach your desired output file after auto-fit operation applied in Ms Excel.