+ Reply to Thread
Results 1 to 10 of 10

Need VBA code to export any selcted item from excel to Powerpoint

  1. #1
    Registered User
    Join Date
    11-14-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2010
    Posts
    4

    Need VBA code to export any selcted item from excel to Powerpoint

    hi,
    i am new to VBA and i need to write a VBA code that should transfer or export any selected thing (whether it may be table, cell or chart ) in Excel Sheet to Powerpoint presentation. My excel Sheet consist of a table and a chart generated from this table.

    So, can anyone help me write this code.

    Thanks

  2. #2
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Need VBA code to export any selcted item from excel to Powerpoint

    Hello there,

    this should get you started

    Please Login or Register  to view this content.
    You need to tick Microsoft Powerpoint Objects Library from VB Editor --> Tools ---> References to enable interaction between Excel and Powerpoint
    Liked the answer given? click * to say so

  3. #3
    Registered User
    Join Date
    11-14-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Need VBA code to export any selcted item from excel to Powerpoint

    hi wakeupcall

    thanks for ur early reply.
    But this code gives an error

    "Object doesn't support this property or method"

    ActiveSheet.ListObjects("Table1")


    And this code is transfering even the chart where i need to transfer only the things that i have selected. Can you please help me in this.

    thanks

  4. #4
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Need VBA code to export any selcted item from excel to Powerpoint

    Well, it would give an error, if your table is not in the currently ActiveSheet or is not called "Table1"

    Try replacing ActiveSheet with Worksheets("the name of sheet with table").ListObjects("Name of Table")

    As to the chart you should replace the the number in brackets after .Slides() with the position of the slide where you need to chart transferred

    Hope this helps,

  5. #5
    Registered User
    Join Date
    11-14-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Need VBA code to export any selcted item from excel to Powerpoint

    Quote Originally Posted by wakeupcall View Post

    Try replacing ActiveSheet with Worksheets("the name of sheet with table").ListObjects("Name of Table")

    i've changed this and tried it but its giving same error.
    and will this code transfer anything i select without giving the range value.

  6. #6
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Need VBA code to export any selcted item from excel to Powerpoint

    Sorry, I don't think I can help further without seeing the whole setup

  7. #7
    Registered User
    Join Date
    11-14-2013
    Location
    bangalore
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Need VBA code to export any selcted item from excel to Powerpoint

    Quote Originally Posted by wakeupcall View Post
    Sorry, I don't think I can help further without seeing the whole setup
    here is a simple example excel sheet i am attaching...
    what i want is
    If i select anything, say L1: Q8 or A1 :Q8 or anything or the chart itself,
    and click the button only the selected range or chart should be transfer to the PPt rather than both
    Attached Files Attached Files

  8. #8
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Need VBA code to export any selcted item from excel to Powerpoint

    Have a stab at this one

    Please Login or Register  to view this content.

  9. #9
    Forum Contributor wakeupcall's Avatar
    Join Date
    02-29-2012
    Location
    Sofia, Bulgaria
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: Need VBA code to export any selcted item from excel to Powerpoint

    Hi wahengme

    Upon some reflection today, I think the code below better reflects your desired end result

    Please Login or Register  to view this content.
    Let me know if this is indeed the case

  10. #10
    Registered User
    Join Date
    06-29-2014
    Location
    Indonesia
    MS-Off Ver
    2010
    Posts
    1

    Re: Need VBA code to export any selcted item from excel to Powerpoint

    ^
    Hi-

    need help...why when use this code have an error slides(unknown member):integer out of range......
    when i change
    PPpres.Slides(32).Shapes.PasteSpecial ppPasteEnhancedMetafile
    became
    PPpres.Slides(1).Shapes.PasteSpecial ppPasteEnhancedMetafile
    the code in not error but it only paste the data in one slide.

    is there an clues so can paste in multiple slides?
    Thanks before..
    Last edited by yumeria; 06-29-2014 at 11:09 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Trying to export results from a PowerPoint quiz to Excel
    By DPWM in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-09-2013, 01:54 PM
  2. VBA Code to export Excel to OVERWRITE an EXISTING PowerPoint
    By rick_tiger in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2012, 04:49 AM
  3. Export data from Excel to PowerPoint
    By nalfin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-01-2009, 09:46 AM
  4. Excel to Powerpoint export
    By webbug08 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-05-2009, 09:41 AM
  5. Export Excel data to Word and PowerPoint
    By racudd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-27-2007, 11:30 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1