Manage Workbook with Golang via C++
Contents
[
Hide
]
Aspose.Cells for C++ provides a powerful and flexible API for managing workbooks and worksheets. This section explains how to create, open, and manipulate workbooks and worksheets programmatically.
Creating a New Workbook
To create a new workbook:
- Create an instance of the Workbook class.
- Add worksheets to the workbook using the WorksheetCollection class.
- Save the workbook using the Save method.
Opening an Existing Workbook
To open an existing workbook:
- Create an instance of the Workbook class and pass the file path to the constructor.
- Access the worksheets using the WorksheetCollection class.
- Modify the workbook as needed.
- Save the workbook using the Save method.
Managing Worksheets
Aspose.Cells for C++ provides a wide range of methods for managing worksheets, including adding, removing, and renaming worksheets.
Adding a Worksheet
To add a new worksheet:
- Access the WorksheetCollection class from the workbook.
- Use the Add method to add a new worksheet.
Removing a Worksheet
To remove a worksheet:
- Access the WorksheetCollection class from the workbook.
- Use the RemoveAt method to remove a worksheet by index.
Renaming a Worksheet
To rename a worksheet:
Conclusion
Aspose.Cells for C++ provides a comprehensive set of tools for managing workbooks and worksheets. Whether you need to create a new workbook, open an existing one, or manipulate worksheets, Aspose.Cells makes it easy to work with Excel files programmatically.