0

We are facing issue in below scenario. Expert advice will be appriciated.

Excel files are being opened with pywin32 library and excel files have User Defined Functions written using an excel addin called PyXLL. These UDFs make rest api calls and every file contains almost 600-700 UDFs.

We are Initialising and Uninitialising com objects in proper manner. Excel crashes in a random manner, if the failed report is tried again it is very much possible that it'll not fail this time. At a time multiple files are processed using python threading.

But we want to stop excel from crashing.

Lakhan
  • 73
  • 1
  • 8
  • 1
    Can you share the code?There are many libraries to process excel files, which one are you using? and a suggestion would be to use try catch in python and print the exception and share it here. – Sammy J Sep 26 '18 at 07:03
  • Thanks Sammy for your interest. I will share code soon but till now i have updated my question with additional details. This might be helpful for your to give suggestion. – Swapnil Pensalwar Sep 27 '18 at 11:16
  • `xlsx` is a zip package containing XML files. You don't need and *shouldn't* use Excel on the server. There are many libraries like [XlsxWriter](https://xlsxwriter.readthedocs.io/) that can produce xlsx files. – Panagiotis Kanavos Sep 27 '18 at 11:17
  • Possible duplicate of [Python convert csv to xlsx](https://stackoverflow.com/questions/17684610/python-convert-csv-to-xlsx) – Panagiotis Kanavos Sep 27 '18 at 11:20

1 Answers1

1

Try not using Excel automation on the server, it is a security risk and not designed for a multi threaded web server environment. Instead, use one of these products:

Closed XML (free)

spreadsheet gear

Aspose Cells

Soft Artisans excel writer

and I am sure there are many more.

Programnik
  • 1,449
  • 1
  • 9
  • 13