how to make Powerpoint app invisible

G

Guest

Hi Guys

I am opening a new powerpoint application for the purpose of expoting excel data into it like .

Set PPApp = New PowerPoint.Applicatio
Set PPPres = PPApp.Presentations.Ad
PPApp.Visible = Tru
PPApp.WindowState = ppWindowMinimize
Set PPPres = PPApp.ActivePresentatio

The problem is i donot want the client to see the powerpoint application while processing is being done
when i do PPApp.Visible = false .it gives me error "hiding the application window is not allowed
Any help will be appreciated

Thanks
Kamal
 
G

Guest

Hi Shyam,

I am pasting excel range into the powerpoint slides
When i remove these 3 lines,i get an error "There is no currently active window" on line
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
When i remove this line also i get error on next line
In func RangeToPPT i pass the excel range to be copied and the powerpoint objects .

My code is as below--
Sub RangeToPPT(ByVal PPApp As PowerPoint.Application, ByVal PPPres As PowerPoint.Presentation, ByVal prmRange As Excel.Range)
Dim PPSlide As PowerPoint.Slide
Dim objRange As Excel.Range
Set objRange = prmRange
Set PPSlide = PPPres.Slides.Add(PPPres.Slides.Count + 1, ppLayoutBlank)
objRange.Select
Application.CutCopyMode = False

objRange.CopyPicture Appearance:=xlScreen, _
Format:=xlPicture

PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex

PPSlide.Shapes.PasteSpecial.Select
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).LockAspectRatio = msoTrue
Call PPPres.Slides(PPSlide.SlideIndex).Shapes(1).ScaleHeight(1, msoFalse, msoScaleFromTopLeft)
Call PPPres.Slides(PPSlide.SlideIndex).Shapes(1).ScaleWidth(1, msoFalse, msoScaleFromTopLeft)
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).Width = 647.45
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).Top = 0
PPPres.Slides(PPSlide.SlideIndex).Shapes(1).Left = 0
PPPres.Slides(PPSlide.SlideIndex).Shapes.Range.Align msoAlignCenters, True
PPPres.Slides(PPSlide.SlideIndex).Shapes.Range.Align msoAlignMiddles, True
Application.CutCopyMode = False

Set objRange = Nothing
End Sub

Any ideas?

Thanks,
Kamal

----- Shyam Pillai wrote: -----

Kamal,
Just remove the following lines. By default PowerPoint will be invisible
till you make it visible.
PPApp.Visible = True
PPApp.WindowState = ppWindowMinimized
Set PPPres = PPApp.ActivePresentation

Regards
Shyam Pillai

http://www.mvps.org/skp
 
C

Chirag

Hi Kamal,

I don't see the need for this line:

PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex

You can remove that line. Also, you already hold a reference to
PPPres.Slides(PPSlide.SlideIndex) in PPSlide variable. You might as well use
PPSlide instead of PPPres.Slides(PPSlide.SlideIndex).

- Chirag
http://officeone.mvps.org/

Kamal said:
Hi Shyam,

I am pasting excel range into the powerpoint slides
When i remove these 3 lines,i get an error "There is no currently active window" on line
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideIndex
When i remove this line also i get error on next line
In func RangeToPPT i pass the excel range to be copied and the powerpoint objects .

My code is as below--
Sub RangeToPPT(ByVal PPApp As PowerPoint.Application, ByVal PPPres As
PowerPoint.Presentation, ByVal prmRange As Excel.Range)
 
G

Guest

Hi Chirag

When i remove this line , i get error on the next line "PPSlide.Shapes.PasteSpecial.Select " in the function The error is like "The window must be in slides or notes view"

Thanks
Kama

----- Chirag wrote: ----

Hi Kamal

I don't see the need for this line

PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideInde

You can remove that line. Also, you already hold a reference t
PPPres.Slides(PPSlide.SlideIndex) in PPSlide variable. You might as well us
PPSlide instead of PPPres.Slides(PPSlide.SlideIndex)

- Chira
http://officeone.mvps.org

Kamal said:
Hi Shyam
When i remove these 3 lines,i get an error "There is no currently activ window" on lin
PPApp.ActiveWindow.View.GotoSlide PPSlide.SlideInde
When i remove this line also i get error on next lin
In func RangeToPPT i pass the excel range to be copied and the powerpoin objects
Sub RangeToPPT(ByVal PPApp As PowerPoint.Application, ByVal PPPres A
PowerPoint.Presentation, ByVal prmRange As Excel.Range
 

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