I’m trying to load up an XLS file into a workbook, but every time I get an error.
When I try to load it via stream I get this error:
RuntimeError: Proxy error(CultureNotFoundException): Culture is not supported. (Parameter ‘culture’)
1033 (0x0409) is an invalid culture identifier.
I have tried running with no load options, running with ac.LoadOptions(ac.LoadFormat.EXCEL_97_TO_2003), and a number of other combinations, but I cannot get it to load.
I tried to use latest version Aspose.Cells for Python via .NET v24.1 with your XLS file and it works fine. Here is my sample code. Aspose.Cells does load and re-save the file fine. Please find attached the output XLS file for your reference.
e.g. Sample code:
@acn
Because you encountered a similar error when running Aspose.Words for Python via .NET, we believe it might be a configuration issue. According to the error message, “1033 (0x0409)” is the culture identifier for American English.
What is your operating system? Could you please check the regional and language settings on your computer? Please run the following code to detect the locale value.
On our computer, the “Regional Format” setting is "English (United States) ".
Additionally, you can try using the following code to set the desired culture:
We are sorry, but we do not provide technical support via phone or online meetings in most cases. The best way to get assistance with your requirements/issue is through forums. As requested earlier, what is your operating system? Also, could you please check the regional and language settings on your computer and provide complete details?
I figured it out, sort of. I switched to an ubuntu image using the requirements, and got it to work. However, I still can’t seem to get the save format cells.SaveFormat.EXCEL_97_TO_2003 to work when saving to a stream. Is this format still supported in v 24.1.0? I am having the same issue with aw.SaveFormat.DOC when working with word documents, though not with slides.export.SaveFormat.PPT, which works fine with a stream output. Screenshot 2024-02-06 at 5.42.40 PM.png (43.5 KB)
@acn
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): CELLSPYTHONNET-188
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Thank you. I got an email notification about another response you had posted including a code snippet you said worked on your end. Is that still true? The following is the message available via email but that I can’t see on here.
@acn SaveFormat.EXCEL_97_TO_2003 format is supported, and the code below runs correctly on our side. Please try running it as well. If there are any issues, please contact us.
with open('Book1.xls', 'rb') as file:
input_stream = io.BytesIO(file.read())
workbook = Workbook(input_stream)
out_stream = io.BytesIO()
workbook.save("Book1_2003.xls", SaveFormat.EXCEL_97_TO_2003)
out_bytes = out_stream.getvalue()
out_stream.close()
Actually I see now that you only tested using a stream to input the file, not to save it. Can you confirm saving to a stream with EXCEL_97_TO_2003 failed on your end as well?
@acn
Yes, it works fine if we save the input stream as an EXCEL_97_TO_2003 format file.
But if we try to save the input stream to a stream with EXCEL_97_TO_2003, the error “Proxy error(NotSupportedException)” indeed occurs. However, saving to the output stream in other formats works fine. Therefore, we created the ticket CELLSPYTHONNET-188.Apologies for the confusion caused.
@acn
We are pleased to inform you that your issue (logged earlier as"CELLSPYTHONNET-188") has been resolved. The fix/enhancement will be included in our upcoming release (v24.3 package) that we plan to publish in the first half of March (next month). You will be notified when the next version is released.