Results 1 to 11 of 11
  1. #1
    New Lounger
    Join Date
    Oct 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel to Powerpoint Macro (1)

    I have an Excel sheet with about 10-20 rows of data over about 6 columns. I'm trying to write a local macro that will pull each row of data into its own slide in Powerpoint. Does anyone have any tips on getting started writing a local macro like this?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Excel to Powerpoint Macro (1)

    Welcome to Woody's Lounge!

    Do you want each row to become a table in a slide in the PowerPoint presentation, or should the text in each cell become a bullet point? Or do you want another layout?

  3. #3
    New Lounger
    Join Date
    Oct 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel to Powerpoint Macro (1)

    I'm looking to make the text in each cell become a bullet point.

    Ideally, I could determine where the bullets go on the slide too, but I don't want to get ahead of myself.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Excel to Powerpoint Macro (1)

    I'll try to come up with something, but it might take a few hours, since I'm not all that familiar with PowerPoint VBA. Perhaps someone else will reply in the meantime.

  5. #5
    New Lounger
    Join Date
    Oct 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel to Powerpoint Macro (1)

    Thanks, Hans! I really appreciate it! ANY insights you have would be great. Thanks again.

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Excel to Powerpoint Macro (1)

    Well, it wasn't so difficult after all. The code in the attached workbook will create a presentation from the cells in the active sheet. The text in column A will be used as title, the text in the other columns as bullet points. You can adapt the code to suit your purposes.
    Attached Files Attached Files

  7. The Following User Says Thank You to HansV For This Useful Post:

    yshendye (2012-08-16)

  8. #7
    New Lounger
    Join Date
    Oct 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel to Powerpoint Macro (1)

    Thanks again for giving me that code.

    I was wondering, maybe a silly question, how do I get around the "macro security is set too high, lower macro security and a digitally assigned Trusted Certificate is not attached to macros" error message? I've decreased macro settings, but can't seem to get into the certificate details. Do I have to give it a certificate?

  9. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Excel to Powerpoint Macro (1)

    If you set macro security to Medium, you'll get prompted to enable macros. Click Yes.
    If you set macro security to Low, macros will be enabled by default. This may seem the easiest setting, but it leaves you unprotected. I always use the Medium setting and live with the prompt.

    You can sign VBA code with a digital certificate. Official certificates are rather expensive, for personal use you can create a certificate using SelfCert.exe.
    Here is a description for Office 2003: Create your own digital certificate
    And for Office XP (2002): Code Signing Office XP Visual Basic for Applications Macro Projects

  10. #9
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Excel to Powerpoint Macro (2003)

    I'm being dragged into PPT, and need to do something like this - however, my need is to paste an Excel selection into the active slide in an existing presentation. Manually I'm doing it in HTML format so as to create a table in the target PPT slide. Since this is my first 30 minutes in PPT VBA, can you direct me as to how I might do that?

    (I know this goes over the edge of asking you to do my work. But PPT isn't recording the step of pasting as an HTML object, even when I paste from within the presentation. And there's no ActiveSlide or CurrentSlide Object, and the PPT Paste method doesn't seem to have any arguments, so I'm lost.)
    -John ... I float in liquid gardens
    UTC -7ąDS

  11. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Excel to Powerpoint Macro (2003)

    PowerPoint VBA is very strange - like Outlook VBA but completely different <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    If I copy a table in Excel, then paste straight into PowerPoint, I get a table object. The code for this is

    ActiveWindow.View.Paste

    If you want to make sure you paste as HTML, you can use

    ActiveWindow.View.PasteSpecial DataType:=ppPasteHTML

  12. #11
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Excel to Powerpoint Macro (2003)

    > PowerPoint VBA is very strange - like Outlook VBA but completely different

    <img src=/S/groan.gif border=0 alt=groan width=16 height=15> Kill me now! <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>

    Thanks for the direction. <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

    Edit: this works for now:

    Sub PasteSelection2PPtHtml()
    ' run from Excel, preselect Excel range
    Dim pptApp As Object
    Dim pptActvWin As Object

    On Error Resume Next
    Set pptApp = GetObject(, "PowerPoint.Application")
    Set pptActvWin = pptApp.ActiveWindow
    If pptActvWin Is Nothing Then
    MsgBox "No PowerPoint presentation open", vbCritical
    GoTo CLEANUP:
    End If

    On Error GoTo 0
    Excel.Application.Selection.SpecialCells(xlCellTyp eVisible).Copy

    With pptActvWin
    .View.PasteSpecial DataType:=ppPasteHTML
    .Selection.ShapeRange.Fill.Background
    End With

    CLEANUP:
    Set pptApp = Nothing
    Set pptActvWin = Nothing
    End Sub
    -John ... I float in liquid gardens
    UTC -7ąDS

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •