Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
To open an Excel file using Aspose.Cells.GridDesktop, you have to create a desktop application with a GridDesktop control in it. If you don’t know how to add the Aspose.Cells.GridDesktop control to your Windows Form, then you should refer to How to use Aspose.Cells.GridDesktop.
Aspose.Cells.GridDesktop provides the following three different ways to open an Excel file.
In this example, create a desktop application and do the following.
To load the content from an Excel file into the Aspose.Cells.GridDesktop control, you will have to call a method of the control to specify the path of the Excel file. After that, Aspose.Cells.GridDesktop will automatically find the file from the specified path and display its contents. The code snippet to load the contents of an Excel file is provided in the below example. Create the Click event of the Open Excel File button and paste the following code inside it.
The above code snippet can be used by developers in any way they choose. For example, if you want to load an Excel file automatically when a Windows Form loads, you can add this code under the Load event of your form.
Aspose.Cells.GridDesktop also supports loading CSV files. Create the Click event of the Open CSV File button and paste the following code inside it.
In the discussion above, we talked about loading an Excel file using its file path, but Aspose.Cells.GridDesktop also supports loading an Excel file from a stream. Create the Click event of the Open from Stream button and paste the following code inside it.
Using a file as a stream is a better approach to avoid file access or sharing‑violation problems because it ensures that all connections to the file are closed when the stream is closed.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.