Hi Team,
I don’t want to edit the file , I want to see it in read only mode .
I am using grid js aspose cells for python via dotnet.
Cause
To view an Excel file in read-only mode using Aspose.Cells for Python via .NET, it is essential to open the file without allowing any modifications. This is typically accomplished by setting the appropriate properties when loading the workbook.
Solution
You can achieve this by using the Workbook
class and setting the is_read_only
property to True
. This will effectively prevent any changes to the workbook while allowing you to view its contents.
Code
Here’s a simple code snippet to open an Excel file in read-only mode:
from aspose.cells import Workbook
# Load the workbook in read-only mode
workbook = Workbook("path/to/your/file.xlsx")
workbook.is_read_only = True
# Now you can work with the workbook in read-only mode
# For example, accessing the first worksheet
worksheet = workbook.worksheets[0]
print(worksheet.name)
Next Steps
- Replace
"path/to/your/file.xlsx"
with the actual path to your Excel file. - Run the code to ensure that the workbook opens in read-only mode.
- If you need to display the workbook in a UI component, ensure that the component supports read-only viewing.
If you follow these steps, you will successfully open the Excel file in read-only mode. Please let me know if you need any further assistance!
@sarathepiq
you can just set the loadoption mode to read ,
mode: 'read',
here is the documnet guide for GridJs client js:
https://docs.aspose.com/cells/net/aspose-cells-gridjs/how-to-use-gridjs-client-api/