Home > other >  MAC xlwings unable to change the font size, the same code can run under Windows
MAC xlwings unable to change the font size, the same code can run under Windows

Time:09-16

Practice writing with xlwings recently, but has a problem, I try to change the font size on the MAC,
Fg1=sheet. Range (" A1: D1 ")
Fg1. Merge ()
Fg1. Value="https://bbs.csdn.net/topics/" consumer bill
Fg1. API. The Font, Size=25
Fg1. API. HorizontalAlignment=- 4108
Fg1. Row_height=38.25
. Including fg1. API. The Font Size=25 this line error, error message is
Traceback (the most recent call last) :
File "/Users/mengchuancao codeLibiary/workShopPy/untitled/venv/lib/python3.8/site - packages/aeosa/appscript/reference. Py", line 599, in __getattr__
Selectortype, code=self. AS_appdata. Referencebyname () [name]
KeyError: 'Font'

The above exception was The direct cause of The following exception:

Traceback (the most recent call last) :
File "/Users/mengchuancao/codeLibiary/workShopPy/autoRecord/automatic billing. Py", line 22, in & lt; module>
SheetStyle ()
File "/Users/mengchuancao/codeLibiary/workShopPy/autoRecord/automatic billing. Py", line 18, in sheetStyle
Fg1. API. The Font, Size=25
File "/Users/mengchuancao codeLibiary/workShopPy/untitled/venv/lib/python3.8/site - packages/aeosa/appscript/reference. Py", line 601, in __getattr__
Raise AttributeError (" Unknown property, element or command: {! R} ". The format (name))
the from eAttributeError: Unknown property, element or command: 'Font'
But this code to run under Windows is normal, python is 3.8, xlwings version 0.19, for help how to solve this problem
  • Related