Hi,
I need to open a Powerpoint File and Export to PDF with no Powerpoint Window.
This function bellow works perfectly:
But If I will change WithWindow:=True to WithWindow:=False, this function returns an error indicates that is no have an ActivePresentation.Code:Public Function PowerPointToPDF(ByVal xSourceFile As String, _ ByVal xDestinationFile As String) As Boolean On Error Resume Next Dim wObj As Object Set wObj = CreateObject("Powerpoint.Application") If (Err = 0) Then wObj.Presentations.Open FileName:=xSourceFile, ReadOnly:=True, WithWindow:=True wObj.ActivePresentation.SaveAs FileName:=xDestinationFile, FileFormat:=32 wObj.ActivePresentation.Close wObj.Quit PowerPointToPDF = (Err = 0) End If Set wObj = Nothing On Error GoTo 0 End Function
In short, I need a function to convert Powerpoint files to PDF without the Powerpoint application window being visible.
Can you help me?
With best regards!




Reply With Quote
