문제

import win32com.client

ExObj = win32com.client.Dispatch("Excel.Application")
ExObj.Visible = 1
wb = ExObj.Workbooks.Open('')
ws = wb.Worksheets[0]
ws.printout()

This opens and sends the excel file to the printer and prints it but then produces the following error:

Traceback (most recent call last):
  File "U:/rmarshall/Work For Staff/ROB/_Python/__Python Projects Code/Time Sheet.py", line 26, in <module>
    ws.printout()
TypeError: 'bool' object is not callable

How do I avoid this error?

도움이 되었습니까?

해결책

I think you have used printout() instead of PrintOut() and it is case sensitive.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top