Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Powerpoint Reference isn't released

Status
Not open for further replies.

ktwclark

Programmer
Jan 30, 2002
54
0
0
GB
I'm having a problem automating Powerpoint through Excel. I want to do a bit more than the code below shows but it highlights my problem. I'm running Windows 2000 and Office 97 and have this procedure in an Excel module. The code is called by a toolbar button. The problem is that when I release the reference to the powerpoint application, it isn't released. If I run the code it appears to work until I try to open the newly saved "abc.ppt" when I get a message that it is already opened! I need to automate Powerpoint behind the scenes, ie invisible, and I think the WithWindow:=False may be having an undesirable effect when it comes to freeing up the resource.

ANy help would be appreciated.

Sub temp()
Dim AppPPt2 As PowerPoint.Application
Application.Cursor = xlWait
Set AppPPt2 = New PowerPoint.Application
AppPPt2.Presentations.Open FileName:="C:\a.ppt", WithWindow:=False
AppPPt2.Presentations(1).SaveAs "C:abc", ppSaveAsPresentation
AppPPt2.Presentations.Item(1).Close
AppPPt2.Quit
Set AppPPt2 = Nothing
Application.Cursor = xlDefault
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top