Unable to suppress PPT window

T

Todd Waldron

Hi all,

I've created an MS-Access application that uses COM Automation to update an
existing PPT template with data from an Excel file. The problem I'm having
is the PPT is visible while it is being updated (while the automation
procedure is running). I'd like to suppress/hide the PPT while it is being
updated so the UI of the MS-Access controller application will stay active
(my next step is to add a progress meter to the UI).

The beginning of the PPT portion of my automation has the following:

***Code Start***

Dim appPPT As PowerPoint.Application
Set appPPT = New PowerPoint.Application
appPPT.Visible = True

***Code End***

If I set [appPPT.Visible = False] I get:

Run-time error '-2147188160(80048240)':
Application (unknown member): Invalid request. Hiding the application window
is not allowed.

Is it possible to suppress/hide the PPT?

Thanks in advance.

Todd Waldron
Austin, Texas
 
T

Todd Waldron

Hi Chirag,

When I remove the line [appPPT.Visible = True] it produces the following
error:

Run-time error '-2147188160 (80048240)':
Presentations (unknown member): Invalid Request. The PowerPoint Frame
window does not exist.

John Wilson (mvp) suggested minimizing the PPT by adding:

appPPT.WindowState = 2

which works, but now my MS-Access window with the UI is not viewable.

Any other ideas?

Thank you,

Todd

Chirag said:
You should not make the ppt window visible in the first place. Remove the
following line:

appPPT.Visible = True

from your code. Does that not work?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

Todd Waldron said:
Hi all,

I've created an MS-Access application that uses COM Automation to update
an
existing PPT template with data from an Excel file. The problem I'm
having
is the PPT is visible while it is being updated (while the automation
procedure is running). I'd like to suppress/hide the PPT while it is
being
updated so the UI of the MS-Access controller application will stay active
(my next step is to add a progress meter to the UI).

The beginning of the PPT portion of my automation has the following:

***Code Start***

Dim appPPT As PowerPoint.Application
Set appPPT = New PowerPoint.Application
appPPT.Visible = True

***Code End***

If I set [appPPT.Visible = False] I get:

Run-time error '-2147188160(80048240)':
Application (unknown member): Invalid request. Hiding the application
window
is not allowed.

Is it possible to suppress/hide the PPT?

Thanks in advance.

Todd Waldron
Austin, Texas
 
C

Chirag

You would need to provide more code so that I can see the offending line.
Are you executing Select method?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

Todd Waldron said:
Hi Chirag,

When I remove the line [appPPT.Visible = True] it produces the following
error:

Run-time error '-2147188160 (80048240)':
Presentations (unknown member): Invalid Request. The PowerPoint Frame
window does not exist.

John Wilson (mvp) suggested minimizing the PPT by adding:

appPPT.WindowState = 2

which works, but now my MS-Access window with the UI is not viewable.

Any other ideas?

Thank you,

Todd

Chirag said:
You should not make the ppt window visible in the first place. Remove the
following line:

appPPT.Visible = True

from your code. Does that not work?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

Todd Waldron said:
Hi all,

I've created an MS-Access application that uses COM Automation to
update
an
existing PPT template with data from an Excel file. The problem I'm
having
is the PPT is visible while it is being updated (while the automation
procedure is running). I'd like to suppress/hide the PPT while it is
being
updated so the UI of the MS-Access controller application will stay
active
(my next step is to add a progress meter to the UI).

The beginning of the PPT portion of my automation has the following:

***Code Start***

Dim appPPT As PowerPoint.Application
Set appPPT = New PowerPoint.Application
appPPT.Visible = True

***Code End***

If I set [appPPT.Visible = False] I get:

Run-time error '-2147188160(80048240)':
Application (unknown member): Invalid request. Hiding the application
window
is not allowed.

Is it possible to suppress/hide the PPT?

Thanks in advance.

Todd Waldron
Austin, Texas
 
T

Todd Waldron

Hi Chirag,

Here is the beginning of the code block where it fails:

***Code Start***

'Declare instance of MS-PowerPoint and it's objects
Dim appPPT As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Dim pptSlide As PowerPoint.Slide
Dim pptShape As PowerPoint.Shape

Set appPPT = New PowerPoint.Application
appPPT.Visible = True

'Open the new PowerPoint presentation file
appPPT.Presentations.Open strTargetDirectory & "\" & strCompanyName
& ".ppt"

***Code End***

If I set [appPPT.Visible = False], it fails on the same line [appPPT.Visible
= False] with the error:

Run-time error '-2147188160(80048240)':
Application (unknown member): Invalid request. Hiding the application window
is not allowed.

If I comment out the line [appPPT.Visible] altogether if fails on the line
[appPPT.Presentations.Open strTargetDirectory & "\" & strCompanyName &
".ppt"] with the error:

Run-time error '-2147188160 (80048240)':
Presentations (unknown member): Invalid Request. The PowerPoint Frame
window does not exist.

Any ideas?

Thank you,

Todd



Chirag said:
You would need to provide more code so that I can see the offending line.
Are you executing Select method?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

Todd Waldron said:
Hi Chirag,

When I remove the line [appPPT.Visible = True] it produces the following
error:

Run-time error '-2147188160 (80048240)':
Presentations (unknown member): Invalid Request. The PowerPoint Frame
window does not exist.

John Wilson (mvp) suggested minimizing the PPT by adding:

appPPT.WindowState = 2

which works, but now my MS-Access window with the UI is not viewable.

Any other ideas?

Thank you,

Todd

Chirag said:
You should not make the ppt window visible in the first place. Remove the
following line:

appPPT.Visible = True

from your code. Does that not work?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

Hi all,

I've created an MS-Access application that uses COM Automation to
update
an
existing PPT template with data from an Excel file. The problem I'm
having
is the PPT is visible while it is being updated (while the automation
procedure is running). I'd like to suppress/hide the PPT while it is
being
updated so the UI of the MS-Access controller application will stay
active
(my next step is to add a progress meter to the UI).

The beginning of the PPT portion of my automation has the following:

***Code Start***

Dim appPPT As PowerPoint.Application
Set appPPT = New PowerPoint.Application
appPPT.Visible = True

***Code End***

If I set [appPPT.Visible = False] I get:

Run-time error '-2147188160(80048240)':
Application (unknown member): Invalid request. Hiding the application
window
is not allowed.

Is it possible to suppress/hide the PPT?

Thanks in advance.

Todd Waldron
Austin, Texas
 
T

Todd Waldron

Hi John,

Thank you for your response. Your suggestion to minimize the window works
great, but then the MS-Access user-interface window (MS-Access is the COM
controller) now becomes unviewable - it ghosts while the PPT update procedure
is running. Any ideas?

Thank you,

Todd


John Wilson said:
Could you maybe set the PowerPoint window to minimise?
appPPT.Visible = True
appPPT.WindowState = 2

--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk


Todd Waldron said:
Hi all,

I've created an MS-Access application that uses COM Automation to update an
existing PPT template with data from an Excel file. The problem I'm having
is the PPT is visible while it is being updated (while the automation
procedure is running). I'd like to suppress/hide the PPT while it is being
updated so the UI of the MS-Access controller application will stay active
(my next step is to add a progress meter to the UI).

The beginning of the PPT portion of my automation has the following:

***Code Start***

Dim appPPT As PowerPoint.Application
Set appPPT = New PowerPoint.Application
appPPT.Visible = True

***Code End***

If I set [appPPT.Visible = False] I get:

Run-time error '-2147188160(80048240)':
Application (unknown member): Invalid request. Hiding the application window
is not allowed.

Is it possible to suppress/hide the PPT?

Thanks in advance.

Todd Waldron
Austin, Texas
 
C

Chirag

Change the line:

appPPT.Presentations.Open strTargetDirectory & "\" & strCompanyName
& ".ppt"

to:

appPPT.Presentations.Open strTargetDirectory & "\" & strCompanyName
& ".ppt", WithWindow:=False

That should get rid of that error. Basically, you want to tell PowerPoint to
not create any window for the presentation that you are opening. So,
PowerPoint does not insist on the main PowerPoint window.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

Todd Waldron said:
Hi Chirag,

Here is the beginning of the code block where it fails:

***Code Start***

'Declare instance of MS-PowerPoint and it's objects
Dim appPPT As PowerPoint.Application
Dim pptPres As PowerPoint.Presentation
Dim pptSlide As PowerPoint.Slide
Dim pptShape As PowerPoint.Shape

Set appPPT = New PowerPoint.Application
appPPT.Visible = True

'Open the new PowerPoint presentation file
appPPT.Presentations.Open strTargetDirectory & "\" & strCompanyName
& ".ppt"

***Code End***

If I set [appPPT.Visible = False], it fails on the same line
[appPPT.Visible
= False] with the error:

Run-time error '-2147188160(80048240)':
Application (unknown member): Invalid request. Hiding the application
window
is not allowed.

If I comment out the line [appPPT.Visible] altogether if fails on the line
[appPPT.Presentations.Open strTargetDirectory & "\" & strCompanyName &
".ppt"] with the error:

Run-time error '-2147188160 (80048240)':
Presentations (unknown member): Invalid Request. The PowerPoint Frame
window does not exist.

Any ideas?

Thank you,

Todd



Chirag said:
You would need to provide more code so that I can see the offending line.
Are you executing Select method?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

Todd Waldron said:
Hi Chirag,

When I remove the line [appPPT.Visible = True] it produces the
following
error:

Run-time error '-2147188160 (80048240)':
Presentations (unknown member): Invalid Request. The PowerPoint Frame
window does not exist.

John Wilson (mvp) suggested minimizing the PPT by adding:

appPPT.WindowState = 2

which works, but now my MS-Access window with the UI is not viewable.

Any other ideas?

Thank you,

Todd

:

You should not make the ppt window visible in the first place. Remove
the
following line:

appPPT.Visible = True

from your code. Does that not work?

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html

message
Hi all,

I've created an MS-Access application that uses COM Automation to
update
an
existing PPT template with data from an Excel file. The problem I'm
having
is the PPT is visible while it is being updated (while the
automation
procedure is running). I'd like to suppress/hide the PPT while it
is
being
updated so the UI of the MS-Access controller application will stay
active
(my next step is to add a progress meter to the UI).

The beginning of the PPT portion of my automation has the following:

***Code Start***

Dim appPPT As PowerPoint.Application
Set appPPT = New PowerPoint.Application
appPPT.Visible = True

***Code End***

If I set [appPPT.Visible = False] I get:

Run-time error '-2147188160(80048240)':
Application (unknown member): Invalid request. Hiding the
application
window
is not allowed.

Is it possible to suppress/hide the PPT?

Thanks in advance.

Todd Waldron
Austin, Texas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top