Can you tell me what this code snippet does? An excel file or screenshots will be very much helpful. After look into it, we will provide you equivalent code if they are available in Aspose.Cells.
Aspose.Cells for .NET does provide a variety of options to extract data from data sources / databases. You can use ImportDataTable, ImportDataView, ImportFromDataReader or even ImportArray methods to import data from these sources and extract data to fill the worksheet cells. See the document for your complete reference: http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/importing-data-to-worksheets.html
Well, I am not an expert of Excel Automation API. So, I am not completely sure about your two lines of code.
1) For the line: outSheet.Select();
If you need to access a sheet for your specific purpose. For example, you need to copy or move a sheet to other Workbooks. Or you need to remove a sheet in the workbook or so etc. Here is a sample code how to get a worksheet in a workbook: //Instantiating a Workbook object Workbook workbook = new Workbook();
//Creating a file stream containing the Excel file to be opened FileStream fstream = new FileStream(“C:\book1.xls”, FileMode.Open);
//Opening the Excel file through the file stream workbook.Open(fstream);
//Obtaining the reference of the first worksheet in the book by passing its sheet index Worksheet worksheet = workbook.Worksheets[0];
//Or by name //Worksheet worksheet = workbook.Worksheets[“Sheet1”];
Please go through these topics if they are useful for your.
2) For the line: outSheet.Application.ActiveCell.Offset(1, 0).Select();
If you need to get a specific cell with respect to a cell in the worksheet. For example you need to format the cell, add value or even copy a range to other range or perform other operations etc.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.