Click here to Skip to main content
15,887,302 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
CApplication app(FALSE);
	

if( !app.CreateDispatch(_T("Powerpoint.Application"))){
    AfxMessageBox(L"Coudn't Start ppt");
    return;
}
else
{
    app.put_Visible(FALSE);




Application.Visible : Inalid request. Hiding the application window is not allowed..

How can i hide???
Posted
Comments
Jochen Arndt 26-Apr-12 3:33am    
With Excel automation, the app is hidden upon creation and can be made visible using the Visible property. Maybe this behaviour applies also to PowerPoint. Is PowerPoint really visible after calling CreateDispatch?

1 solution

Can't be sure it's what you want, since I don't know your intention.

However, by default it's not visible when started using automation features.
The following works for me from excel VBA. No PPT window is shown, the file is created, the application doesn't remain in the task manager.



VB
Sub CreatePptFileInBkg()
    Dim ppt As Object
    Dim curPres As Object
    Set ppt = CreateObject("PowerPoint.Application")
    Set curPres = ppt.Presentations.Add
    curPres.SaveAs FileName:="c:\PPTSample1.pptx"
    ppt.Quit
End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900