Skip to content

Problem saving PowerPoint files as PDFs #175

Closed as not planned
Closed as not planned

Description

@petgriffin

Hi

I have a similar issue to this one (comtypes 1.1.7):

#129

My code snippet is

import comtypes.client

ppFormatPDF = 32

for fname in ["test1", "test2"]:
in_file = fname + ".pptx"
out_file = fname + ".pdf"
app = comtypes.client.CreateObject('Powerpoint.Application')
ppt = app.Presentations.Open(in_file)
ppt.SaveAs(out_file, FileFormat=ppFormatPDF)
ppt.Close()
app.Quit()

This seems to work OK saving test1.pptx as a PDF but trying to save the next one results in this error:

ppt.SaveAs(out_file, FileFormat=ppFormatPDF)
_ctypes.COMError: (-2147188720, None, ('Presentation (unknown member) : Object does not exist.', 'Microsoft PowerPoint', '', 0, None))

Would appreciate any thoughts you may have - thanks!

Activity

  1. vidartrojenborg commented on Oct 4, 2020

    @vidartrojenborg

    Seeing the exact same issue.

  2. added
    3rd-party issuerelated to specific windows stuffs or python packages
    and removed
    3rd-party issuerelated to specific windows stuffs or python packages
    on Oct 8, 2020
  3. vasily-v-ryabov commented on Oct 8, 2020

    @vasily-v-ryabov
    Collaborator

    Looks like language independent problem with PowerPoint COM interface usage. Guys could solve similar one (the same error code) with VBScript: https://stackoverflow.com/q/54508873/3648361

  4. junkmd commented on Aug 25, 2024

    @junkmd
    Collaborator

    Since there have been no updates on this issue for a long time, I will close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3rd-party issuerelated to specific windows stuffs or python packages

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions