at the last line wb.save, I get an error in openpyxl/writer/worksheet.py, line 192, in write_worksheet to the effect
with xmlfile(out) as xf:
TypeError: 'module' object is not callable.

Any help is much appreciated.

]]>https://forum.omz-software.com/topic/2458/openpyxl-problemRSS for NodeSat, 25 May 2019 12:49:55 GMTTue, 15 Dec 2015 02:08:55 GMT60I am able to import openpyxl but when I try to run a sample script I get an error which I could use some help understanding.

Line 16 of functions.py is looking to see if the lxml module is present. Lxml is NOT present in Pythonista so line 51 imports xmlfile from et_xmlfile.

At this point I could not find et_xmlfile. ET phone home.

]]>https://forum.omz-software.com/topic/2458/openpyxl-problem/2https://forum.omz-software.com/topic/2458/openpyxl-problem/2Tue, 15 Dec 2015 03:07:22 GMTThank you. I found et_xmlfile, and added it to the library and now this simple script works.
]]>https://forum.omz-software.com/topic/2458/openpyxl-problem/3https://forum.omz-software.com/topic/2458/openpyxl-problem/3Tue, 15 Dec 2015 03:52:16 GMTThis error statement TypeError: 'module' object is not callable is raised as you are being confused about the Class name and Module name. The problem is in the import line . You are importing a module, not a class. This happend because the module name and class name have the same name .

If you have a class "MyClass" in a file called "MyClass.py" , then you should import :

from MyClass import MyClass

In Python , a script is a module, whose name is determined by the filename . So when you start out your file MyClass.py with import MyClass you are creating a loop in the module structure.