我正在尝试在 python 线程中使用预先打开的 excel com 对象打开工作簿。使用以下代码:
from multiprocessing import Process, Queue
def open_workbook(excel,iSub_Loc,q):
p = Process(target = open_workbook_helper, args = (excel,iSub_Loc))
p.daemon = True
p.start()
def open_workbook_helper(excel,iSub_Locq,):
wb = excel.Workbooks.Open(iSub_Loc)
ws = wb.Sheets(1)
q.put((wb,ws))
但我收到以下错误
Can't pickle <type PyIDispatch'>: it's not found as __builtin__.PyIDispatch
有什么建议么?