Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xlsx 转 PDF 报错: File "<COMObject <unknown>>", line 3, in ExportAsFixedFormat ? #105

Open
ituserxxx opened this issue Jul 7, 2023 · 0 comments

Comments

@ituserxxx
Copy link

my project dir

  • m1.xlsx
  • main.py

this main.py code

import poexcel
if __name__ == '__main__':
    poexcel.excel2pdf(excel_path=r".\m1.xlsx",pdf_path=r".\test.pdf")

exec result

files amount:1
files amount:1
Traceback (most recent call last):
  File "C:\Users\xxx\python_project\xlsx2pdf\main.py", line 6, in <module>
    poexcel.excel2pdf(
  File "C:\Users\xxx\python_project\xlsx2pdf\venv\lib\site-packages\poexcel\api\excel.py", line 58, in excel2pdf
    mainExcel.excel2pdf(excel_path, pdf_path, sheet_id)
  File "C:\Users\xxx\python_project\xlsx2pdf\venv\lib\site-packages\poexcel\core\ExcelType.py", line 162, in excel2pdf
    sheet.to_pdf(path=pdf_path_name, show=False)
  File "C:\Users\xxx\python_project\xlsx2pdf\venv\lib\site-packages\xlwings\main.py", line 1569, in to_pdf
    return self.book.to_pdf(
  File "C:\Users\xxx\python_project\xlsx2pdf\venv\lib\site-packages\xlwings\main.py", line 1275, in to_pdf
    return utils.to_pdf(
  File "C:\Users\xxx\python_project\xlsx2pdf\venv\lib\site-packages\xlwings\utils.py", line 662, in to_pdf
    obj.impl.to_pdf(os.path.realpath(report_path), quality=quality)
  File "C:\Users\xxx\python_project\xlsx2pdf\venv\lib\site-packages\xlwings\_xlwindows.py", line 920, in to_pdf
    self.xl.ExportAsFixedFormat(
  File "C:\Users\xxx\python_project\xlsx2pdf\venv\lib\site-packages\xlwings\_xlwindows.py", line 122, in __call__
    v = self.__method(*args, **kwargs)
  File "<COMObject <unknown>>", line 3, in ExportAsFixedFormat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant