How can I create multiple instance of PowerPoint by VB6's 'CreateObject'

  • Thread starter Thread starter Zoo
  • Start date Start date
Z

Zoo

Hi,
I want to create multiple instance of PowerPoint by VB6's 'CreateObject'.

Sub Test()
Set p1 = CreateObject("PowerPoint.Application")
p1.Visible = True

Set p2 = CreateObject("PowerPoint.Application")
p2.Visible = True
End Sub

In this case, p1 is equal to p2. This means the number of instance is 1.
I know PowerPoint is the application which does not support multiple
instance.
But , is there workaround?
 
Is there a particular reason you need 2 application object instances?
Could you just work with 2 presentation objects instead?

Sub Test()
Set p1 = CreateObject("PowerPoint.Application")
Set pres1 = p1.Presentations.Open(sFile1, , , False)
Set pres2 = p1.Presentations.Open(sFile2, , , False)
End Sub
 
Thank you , John.

Great. But , as you've said , it may be not useful.
Anyway, I'll check to see if it is possible.
 
Thank you for your reply , Carmen.

The reason is that I want my VB6 Application not to obstarct user's
operation on PowerPoint.
The operation I want my VB6 to have is to unlink all the links of specific
ppt files in the background.
If user's slide show is in process at that moment ,
I'm afraid, they (the slide show and the unlinking process) will compete
against each other.
 
So you are looking to have the user run an instance of PowerPoint AND
run your application simultaneously where your application is also
creating an instance of PPT?

If so, maybe you could use the FindWindow API call to track your
PowerPoint instance and run methods on that object. I don't think that
would interfere with another instance of PPT that may be running. It
may be tricky though.
 
Back
Top