import xlwings as xw
app=xw.App(visible=True,add_book=False)
for i in range(1,21):
workbook=app.books.add()
workbook.save(f'e:\\example\\01\\员工信息表\\分公司{i}.xslx')
workbook.close()
app.quit()
Traceback (most recent call last):
File "C:\Users\hp\Desktop\练习\Example01.py", line 14, in <module>
workbook.save(f'e:\\example\\01\\员工信息表\\分公司{i}.xslx')
File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\site-packages\xlwings\main.py", line 741, in save
self.impl.save(path)
File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\site-packages\xlwings\_xlwindows.py", line 537, in save
self.xl.SaveAs(os.path.realpath(path))
File "C:\Users\hp\AppData\Local\Programs\Python\Python38\lib\site-packages\xlwings\_xlwindows.py", line 66, in __call__
v = self.__method(*args, **kwargs)
File "C:\Users\hp\AppData\Local\Temp\gen_py\3.8\00020813-0000-0000-C000-000000000046x0x1x9.py", line 46793, in SaveAs
return self._oleobj_.InvokeTypes(3174, LCID, 1, (24, 0), ((12, 17), (12, 17), (12, 17), (12, 17), (12, 17), (12, 17), (3, 49), (12, 17), (12, 17), (12, 17), (12, 17), (12, 17), (12, 17)),Filename
pywintypes.com_error: (-2147352573, '找不到成员。', None, None)