UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Access VBA Add Powerpoint Slide, Office 2010    
 
   
Neondog82
post Jun 8 2014, 11:06 AM
Post#1



Posts: 75
Joined: 30-August 06



Hello all, I'm trying to create a PowerPoint Presentation from Access and I am having trouble with the basics. With the code below, I am able to open PowerPoint, create a new Presentation, but I can't add any slides to it. I get a "Type Mismatch" error on the last line of code for ppLayoutBlank. I tried setting my own CustomLayout but was not successful. I've read throug the MS Developer Reference, but still can't get it. Any help on being able to add a slide to my presentation would be much appreciated.
!--c1-->
CODE
'PowerPoint Variables
Dim PPA As PowerPoint.Application
Dim PPP As PowerPoint.Presentation
Dim PPL As PowerPoint.CustomLayout
'Set PowerPoint Variables
Set PPA = New PowerPoint.Application    'Open PowerPoint
PPA.Visible = msoTrue                   'Show PowerPoint
Set PPP = PPA.Presentations.Add         'Create new presentation
PPP.Slides.AddSlide 1, ppLayoutBlank
Go to the top of the page
 
CyberCow
post Jun 8 2014, 11:30 AM
Post#2


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


NeonDog - see if either of these two links provide any insight . . .
http://msdn.microsoft.com/en-us/library/of...office.15).aspx
or
http://www.vbaexpress.com/kb/getarticle.php?kb_id=177
hope this helps hat_tip.gif
Go to the top of the page
 
Neondog82
post Jun 8 2014, 11:41 AM
Post#3



Posts: 75
Joined: 30-August 06



Thanks for the help CyberCow. I have already been to both of those sites. I made sure to reference in my origianl post that I looked at the develpers reference already. I am wanting to understand why what I have isn't working.
Go to the top of the page
 
CyberCow
post Jun 8 2014, 11:59 AM
Post#4


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


Do you have a Library Reference checked for the Power Point (and\or Office Objects)?
Admittedly, I've never worked with automation between Access and Power point, so I'm somewhat poking in the dark.
Go to the top of the page
 
zocker
post Jun 8 2014, 05:32 PM
Post#5


Utterly Eccentric and Moderator
Posts: 4,055
Joined: 4-March 00
From: Bristol / Ipswich / Spain


Oh this automation stuff is always tricky, my suggestion is use the Macro recorder in PPt to do what you would like to do, look at the code in the macro which is written and then copy paste it to your controlling app....I spose there is a macro recorder in 2010?
All the best
zocker
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    16th December 2017 - 11:29 PM