After deployment, can I have multiple users edit the same sheet simultaneously?
Yes, you can have multiple users edit the same sheet simultaneously by creating a shared workbook using Aspose.Cells for .NET. To enable this feature, you need to set the Shared
property of the Workbook
object to true
. This allows users to collaborate on the workbook, and any changes made by one user will be visible to others in real time.
Here’s a brief overview of the steps to create a shared workbook:
- Set Output Directory: Define where the shared workbook will be saved.
- Create a Workbook Object: Instantiate a new
Workbook
object to represent your Excel workbook. - Enable Workbook Sharing: Set the
Shared
property of theWorkbook
object totrue
. - Save the Shared Workbook: Specify the path and name for the output file and save the workbook.
Here is a sample code snippet to illustrate this:
// Step 1: Set output directory
string outputDir = "path_to_output_directory";
// Step 2: Create a Workbook Object
Workbook workbook = new Workbook();
// Step 3: Enable Workbook Sharing
workbook.IsShared = true;
// Step 4: Save the shared workbook
workbook.Save(Path.Combine(outputDir, "SharedWorkbook.xlsx"));
Once the shared workbook is created, you can distribute the Excel file to other users, allowing them to open and edit it simultaneously. Keep in mind that while most Excel features are supported in a shared workbook, some advanced features may have limitations.
For more detailed information, you can refer to the Aspose.Cells documentation on creating shared workbooks.
Sources:
[1]: Create Shared Workbook | Aspose.Cells for .NET API Reference
@Jedidah
What application do you use?
If you use Grid.Js, it uses a unique ID to identify the cache of the workbook. Users can edit the same workbook one by one, but not simultaneously. For example, when one user edits the below workbook file in the editor app, and then another user also opens this same URL (with the same UID) to edit it, the update operation is processed one by one, and both updates will be saved to the same workbook file via the same UID.
@peter.zhou
Actually, I have not started using it yet. Im looking at whether Aspose.Cells suits my requirements. The documentation on shared workbook states that the shared workbook allows multiple users to simultaneously collaborate on data.
@Jedidah
Thank you for your feedback. Please take your time to evaluate your needs, and if you have any questions, please feel free to contact us at any time. You can use the following API to get or set a value that indicates whether the Workbook is shared.
Workbook wb = new Workbook("sample.xlsx");
//Share the Workbook
wb.Settings.Shared = true;
wb.Save("out.xlsx");
Hope helps a bit.
@Jedidah
And if you are talking about manipulating/modifying the same workbook instance with Aspose.Cells in multi-threads environment, we are afraid it is not supported. There are too many data and procedures need to be synchronized to support multi-threads and such kind of lock will cause serious performance issue for most users and general situations. So, users need to manage the processes by themselves when using multi-threads with Aspose.Cells.
@John.He
Is there a test dll that we can use to evaluate whether all our requirements are being met?