Spire.XLS is a professional Excel API that enables developers to create, manage, manipulate, convert and print Excel worksheets. Get free and professional technical support for Spire.XLS for .NET, Java, Android, C++, Python.

Mon Dec 09, 2024 4:47 pm

There is a (new?) bug when using the Python versions of Spire.Xls 14.9.3 and Spire.Doc 12.12.0. Approximately 30% (6 / 20 in the tests I ran) of the time, running the example program in https://github.com/EricRobertCampbell/s ... -excel-mwe (crash_change.py) results in an exception when trying to access the worksheets.

Code: Select all
Error generating document: Arg_NullReferenceException:   at Spire.Xls.AOT.NLWorkbook.Workbook_get_Worksheets(IntPtr, IntPtr) + 0x47
Traceback (most recent call last):
  File "/home/eric/documents/spire-failure-doc-then-excel-mwe/./crash_change.py", line 40, in simulated_generate_documents
    f()
  File "/home/eric/documents/spire-failure-doc-then-excel-mwe/./crash_change.py", line 71, in generate_xlsx_docs
    sheet = wb.Worksheets[0]
  File "/home/eric/documents/spire-failure-doc-then-excel-mwe/venv/lib/python3.9/site-packages/spire/xls/Workbook.py", line 2081, in Worksheets
    intPtr = CallCFunction(GetDllLibXls().Workbook_get_Worksheets, self.Ptr)
  File "/home/eric/documents/spire-failure-doc-then-excel-mwe/venv/lib/python3.9/site-packages/spire/xls/common/__init__.py", line 113, in CallCFunction
    raise SpireException(info)
spire.xls.common.SpireException: Arg_NullReferenceException:   at Spire.Xls.AOT.NLWorkbook.Workbook_get_Worksheets(IntPtr, IntPtr) + 0x47


I am using Ubuntu 22.04.1 and Python 3.9.16, but there is also a Docker image in the linked repo.

ericcampbell
 
Posts: 10
Joined: Thu Jun 27, 2024 10:39 pm

Tue Dec 10, 2024 2:11 am

Hello,

Thanks for your inquiry.

Please note that ensuring the successful installation of libfontconfig1 using the command "apt-get install -y libfontconfig1" is crucial on Ubuntu.
If you have completed this step and the error still exists, please let me know.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2998
Joined: Wed Jun 27, 2012 8:50 am

Thu Dec 12, 2024 8:55 am

Hello,

Hope you are doing well.

Has your issue been solved? I'm looking forward to your feedback soon.

Sincerely,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2998
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.XLS