Resolving an error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am editing a Powerpoint slide using VBA in Excel. I have created 2 objects:
oPPT - a powerpoint file object
PPApp - a powerpoint application object

When I get to the SaveAs statement, I get the following error message in
Excel:
Run time error: -2147024809(80070057)
Presentation.SaveAs: Invalid enumeration Value

The two variations I have tried to use are:

PPApp.ActivePresentation.SaveAs Filename:=strPath &
"\images\map\legend.jpg", FileFormat:=ppSaveAsJPG,
EmbedTrueTypeFonts:=msoFalse

- OR -

oPPT.SaveAs Filename:=strPath & "\images\map\legend.jpg",
FileFormat:=ppSaveAsJPG, EmbedTrueTypeFonts:=msoFalse

How do I resolve this?

Thanks in advance
 
Andy Dorph said:
I am editing a Powerpoint slide using VBA in Excel. I have created 2 objects:
oPPT - a powerpoint file object
PPApp - a powerpoint application object

When I get to the SaveAs statement, I get the following error message in
Excel:
Run time error: -2147024809(80070057)
Presentation.SaveAs: Invalid enumeration Value

The two variations I have tried to use are:

PPApp.ActivePresentation.SaveAs Filename:=strPath &
"\images\map\legend.jpg", FileFormat:=ppSaveAsJPG,
EmbedTrueTypeFonts:=msoFalse

- OR -

oPPT.SaveAs Filename:=strPath & "\images\map\legend.jpg",
FileFormat:=ppSaveAsJPG, EmbedTrueTypeFonts:=msoFalse

How do I resolve this?

Either add a reference to PowerPoint in your Excel vba project or use the values
of PPT constants like ppSaveAsJPG rather than the names of the constants (which
aren't defined in Excel). Or define them in your module:

Const ppSaveAsJPG as Long = 17
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top