#1
|
|||
|
|||
Content to be imported to PPT from excel usingVBA/Macro/Addin
I need the content in the excel to be exported into PPT into different slides (in different lines) in a text box at the bottom of the slide.
Slide 1 will be a blank slide with the logo.... Slide 2 should contain text like below (Row 2 from Excel) 001 4-Jun-08 Krishna @krishnaM2008 @Test #Test scrabble the words... it has all the element in it https://twitter.com/KrishnaM2008/sta...284544/photo/1 Original Slide 3 should contain text from Row 3 and so on... Is there a way to use Macro/VBA/Addin to make this possible ? Thanks, Tejas |
#2
|
|||
|
|||
Maybe this EXCEL macro will get you started.
Code:
Sub CaptionPPT() Dim pptapp As Object Dim pptpres As Object Dim lngCount As Long Dim SW As Long Const ppAlignCenter = 2 Set pptapp = CreateObject(Class:="PowerPoint.Application") pptapp.Visible = True 'change the address as required Set pptpres = pptapp.Presentations.Open("C:\Users\John\Desktop\test.pptx") For lngCount = 2 To pptpres.slides.Count With pptpres.slides(lngCount).Shapes.AddTextbox(msoTextOrientationHorizontal, _ pptpres.PageSetup.SlideWidth / 2 - 100, pptpres.PageSetup.SlideHeight - 50, 200, 15) .TextFrame.TextRange.Text = ActiveSheet.Range("A1").Offset(lngCount - 1, 0) .TextFrame.TextRange.ParagraphFormat.Alignment = ppAlignCenter End With Next End Sub |
#3
|
|||
|
|||
Thanks John, But after adding this into the VBA module & running it ( with the location changed to mine) , it doesn't work.
The only thing which happens is opening up a PPT which is blank. Nothing else happens. Was this the only thing in the macro ? I am not very familiar with the VBA coding so not sure if that is what you have suggested for now. If not, is it possible for you to send me the PPT & the excel file with macro enabled in a zip file ? post it here or may be mail me at tmaster81@gmail.com Thanks a a ton for your help. |
#4
|
|||
|
|||
if you send me the Excel file AND the PowerPoint file (maybe just a couple of slides) I can tell you what is wrong. I have also mailed you a link to a private dropbox folder.
john ATSIGNHERE PPTAlchemy.co.uk |
#5
|
|||
|
|||
Hi John,
I have uploaded both the files in the DropBox folder provided by you. Thanks, Tejas Master |
#6
|
|||
|
|||
I have corrected the code in the dropbox to account for the Excel layout used. Note the extra line feed that appears in PPT is not being added by the code it is part of the Excel data which you probably need to delete
|
#7
|
|||
|
|||
Thanks a ton John, This is what I wanted. I'll have to work around to get the actual format I need, But this is the draft of what I would require.
Thanks a ton, God Bless you. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
macro for change content of cell2 when content of cell1 changes | Intruder | Excel Programming | 1 | 11-17-2012 08:24 PM |
Macro to link 2 content controls | bortonj88 | Word VBA | 2 | 08-21-2012 06:24 AM |
Anybody know a macro that applies autocorrect to pasted content? | dennisk | Word VBA | 1 | 06-09-2011 12:26 AM |
Macro to put content into keywords properties? | erik2000 | Word VBA | 3 | 03-05-2010 10:14 PM |
New Excel Addin - Office 2003 Color Pallete | ioamnesia | Excel | 1 | 05-08-2009 10:46 AM |