Hi,
Thanks for reporting and considering Aspose.Cells for .NET.
I was able to replicate the problem using the latest version:
Aspose.Cells for .NET v7.0.1.5
We have logged this issue in our database. Once the issue is fixed or we get some update, we will let you know asap.
This issue has been logged as CELLSNET-31068.
Below is the code and exception for a reference.
C#
string filePath = @“F:\Shak-Data-RW\Downloads\DeleteRange.xlsx”;
WorkbookDesigner designer =
new WorkbookDesigner();
Workbook workbook =
new Workbook(filePath);
designer.Workbook = workbook;
Range range = workbook.Worksheets.GetRangeByName(“DUP_Project”);
Worksheet worksheet = range.Worksheet;
Cells cells = range.Worksheet.Cells;
cells.DeleteRange(range.FirstRow, range.FirstColumn, range.FirstRow + range.RowCount - 1, range.FirstColumn + range.ColumnCount - 1, ShiftType.Left);
workbook.Save(filePath + “.
out.xlsx”);
ExceptionSystem.ArgumentOutOfRangeException was unhandled
Message=
"Specified argument was out of the range of valid values."
Source="Aspose.Cells"
StackTrace:
at Aspose.Cells.Workbook.Save(String fileName, SaveOptions saveOptions)
at Aspose.Cells.Workbook.Save(String fileName)
at AsposeProject.Program.f1() in F:\Shak-Data-RW\Projects\AsposeProject\AsposeProject\Program.cs:line 91
at AsposeProject.Program.Main(String[] args) in F:\Shak-Data-RW\Projects\AsposeProject\AsposeProject\Program.cs:line 57
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: