E
Evandro Contato
Hello everyone,
I need open export and close powerpoint, for this I developed and installed the following macro to add in.
Option Explicit
Public WithEvents PPTEvent As Application
Private Sub PPTEvent_AfterPresentationOpen(ByVal Pres As Presentation)
ShowPPT
End Sub
Sub ShowPPT()
ActivePresentation.ExportAsFixedFormat ActivePresentation.Path & "\" & ActivePresentation.Name & ".pdf", ppFixedFormatTypePDF
ActivePresentation.Close
Application.Quit 'this does not work
End Sub
Ok, open and the export ok, but the closing does not work, gives error event handler.
Error: Application (unknown member): Invalid Request. This operation cannot be performed in this event handler.
I tried to put a timer to close the application after 1 second but did not work.
Any idea how to solve?
Thank you,
Evandro
I need open export and close powerpoint, for this I developed and installed the following macro to add in.
Option Explicit
Public WithEvents PPTEvent As Application
Private Sub PPTEvent_AfterPresentationOpen(ByVal Pres As Presentation)
ShowPPT
End Sub
Sub ShowPPT()
ActivePresentation.ExportAsFixedFormat ActivePresentation.Path & "\" & ActivePresentation.Name & ".pdf", ppFixedFormatTypePDF
ActivePresentation.Close
Application.Quit 'this does not work
End Sub
Ok, open and the export ok, but the closing does not work, gives error event handler.
Error: Application (unknown member): Invalid Request. This operation cannot be performed in this event handler.
I tried to put a timer to close the application after 1 second but did not work.
Any idea how to solve?
Thank you,
Evandro