from aspose.cells import Workbook # For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET # The path to the documents directory. dataDir = RunExamples.GetDataDir(".") # Creating a file stream containing the Excel file to be opened fstream = open(dataDir + "book1.xls", "rb") # Instantiating a Workbook object # Opening the Excel file through the file stream workbook = Workbook(fstream) # Accessing the first worksheet in the Excel file worksheet = workbook.worksheets[0] # Ungrouping first six rows (from 0 to 5) worksheet.cells.ungroup_rows(0, 5) # Ungrouping first three columns (from 0 to 2) worksheet.cells.ungroup_columns(0, 2) # Saving the modified Excel file workbook.save(dataDir + "output.xls") # Closing the file stream to free all resources fstream.close()