We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Error: file is locked after using Cells.DeleteRow(x)

Ver 1.8.5.2
if i put : Cells.DeleteRow(16);
and then : excel.Save(“report.xls”, SaveType.OpenInBrowser, FileFormatType.Default, this.Response);

msg error: report.xls is locked for editing
that means file is in use
can you help me?

Thanks

Which version are you using?

If you removed Cells.DeleteRow(x), did it work fine?
If yes, could you send me an email? I will send you an internal fix for this issue.

it worked fine.
please send me the fix version to mrtuanvn@yahoo.com
thanks

I have sent it to you. Please have a try.

Really a strange problem. It works all fine in my machine. Could you post more code here? Or you can send it to me by email. If you use a designer file(template), please also send it to me.

Thanks for your cooperation.

@Aspuser,
Aspose.Excel is deprecated now and is replaced by a highly efficient and feature-rich product Aspose.Cells. This new product not only contains all the features provided by Aspose.Excel but also supports the advanced features provided by the latest versions of MS Excel. You can delete rows with this product as shown below:

// Creating a file stream containing the Excel file to be opened
FileStream fstream = new FileStream(dataDir + "Book1.xlsx", FileMode.OpenOrCreate);

// Instantiating a Workbook object
// Opening the Excel file through the file stream
Workbook workbook = new Workbook(fstream);

// Accessing the first worksheet in the Excel file
Worksheet worksheet = workbook.Worksheets[0];

// Deleting 10 rows from the worksheet starting from 3rd row
worksheet.Cells.DeleteRows(2, 10);

// Saving the modified Excel file
workbook.Save(dataDir + "output.xlsx");

// Closing the file stream to free all resources
fstream.Close();

You can get more information about inserting and deleting rows and columns here:
Inserting and Deleting Rows and Columns

Youm may download the latest product here:
Aspose.Cells for .NET (Latest Version)

To test the latest features a ready to run solution is available here.