+ Reply to Thread
Results 1 to 28 of 28

Copy All Sheets to an Existing PowerPoint Template

  1. #1
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Copy All Sheets to an Existing PowerPoint Template

    I have a Workbook, that I would like to copy over to an existing PowerPoint template.

    The order that the sheets are currently in, is the same order I would like the presentation to be.

    Can this be done all at once with command button?

    Please see attachment for examples of the Workbook and PowerPoint template
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    http://www.excelforum.com/excel-prog...nt-slides.html

  3. #3
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    Try a copy and paste and see if that is really what you want.

  4. #4
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    Kennth Hobson,

    There was noting attached to your reply to copy.

  5. #5
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    I meant select "your" range in Excel and manually copy and paste it to an open PPT slide.

  6. #6
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    Sorry about that.

    I see what you were referring to by copy and paste to see if that is what your want. I have done so and it is fine. I know that will have to manually resize once the ranges were sent to the PowerPoint presentation.

    I plan to use this with other spreadsheets. So once i can just change the range in your code, copy and paste it in another workbook, and have a PowerPoint presentation created, that will be great.

  7. #7
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    Change the path and filename as needed. You can also change what slide to offset from.

    You may want to autofit the columns first. Some data may not show if your line is too long.

    I added some functions to get the usedrange a bit better than the UsedRange method.
    Please Login or Register  to view this content.
    Last edited by Kenneth Hobson; 04-06-2009 at 11:21 AM.

  8. #8
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    I have copied and pasted the code into the excel file that I have attached to this thread.

    1.) I am not sure if I changed the "path name" to path on my computer correctly for the excel workbook and the existing powerpoint presentation. ( This is what i have)

    Please Login or Register  to view this content.
    2.) When I run the code, I get an error message : User defined type not define and this is the line it highlights

    Please Login or Register  to view this content.
    I apologize for my ignorance. Please provide me with an example on how to change the path name.

  9. #9
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    You defined 2 paths. Use:
    Please Login or Register  to view this content.
    The user defined error is due to the word Slide. Since you are using late binding, change it to Object.
    Please Login or Register  to view this content.
    I may have to tinker a bit to make sure that is right. We may need to pass an additional parameter for Dim object. What you might consider doing is what I do. Use both early and late binding so Slide would be fine then. In Tools > References, select the Microsoft Powerpoint object.
    Last edited by Kenneth Hobson; 04-06-2009 at 09:59 AM.

  10. #10
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    Ok.

    What about the error message regarding this line in the code?

    Please Login or Register  to view this content.

  11. #11
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    The user defined error is due to the word Slide. Since you are using late binding, change it to Object.

    The user defined error is due to the word Slide. Since you are using late binding, change it to Object.

    Code:
    Function GetActiveSlide(ByVal Wnd As Object) As Object
    Dim Sld As Object

    Select Case TypeName(Wnd)
    Case "DocumentWindow"
    Set Sld = Wnd.Selection.SlideRange(1)
    Case "SlideShowWindow"
    Set Sld = Wnd.View.Slide
    End Select

    Set GetActiveSlide = Sld
    End FunctionI may have to tinker a bit to make sure that is right. We may need to pass an additional parameter for Dim object. What you might consider doing is what I do. Use both early and late binding so Slide would be fine then. In Tools > References, select the Microsoft Powerpoint object.

  12. #12
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    ok.

    I have edited your code to with the new changes you provided me.
    It did copy over the existing PowerPoint template( yeah@!!) . However, only a portion of the range was copied from each sheet.

    Please see the new attachment.

  13. #13
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    See the 2nd sentence in my post #7. You have to autofit the data first. A macro could do that for you but you may still miss some parts if it is too long. You can press Alt+Enter to make your long text strings flow a bit better.

    You may want to autofit the columns first. Some data may not show if your line is too long.
    Last edited by Kenneth Hobson; 04-06-2009 at 11:21 AM.

  14. #14
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    I took your advice and auto fit the columns.

    It come out nice.

    Now, the quesition that I have is that I want to use this same code in another workbook to create a PowerPoint from an existing template.

    It is possible to use this same code to create a PowerPoint presentation from an existing template?

    Do I need to specify in particular range? Or this code work for any workbook with any kind of range?

    I have tried to use the code, but the same cutting of is happening. And autofitting the columns is not an option in this particular workbook.

    Please see attached
    Attached Files Attached Files
    Last edited by NaNaBoo; 04-06-2009 at 01:50 PM.

  15. #15
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    Not sure what you mean. You can record a macro in PowerPoint to open your Template. Your offset would be 1 in that case I suspect. The key is to copy the code parts that you need. This code will work but you need that first part to set your template to open first. It could save the file and then this code would take over.

  16. #16
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    I am not sure what parts to copy over. The attached workbook, uses the same code that you provided. When the images are copied over to the PowerPoint, it does not show the entire image. The image is cut off.

    The is a different between how this workbook is structured compared to the first workbook that I attached

    Can we fix this by inserting a specified range, such as, A1:Z50?

    Did you get a chance to open up the workbook and see what I am talking about?
    Last edited by NaNaBoo; 04-06-2009 at 02:18 PM.

  17. #17
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    If you mean add to your presentation after button 1 then button 2 might go something like:
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    I think I am confusing you how.

    Let ignore Button1. That was first code that you provided me so that I send a one single sheet to a PowerPoint presentation. It was just saved in this attachment.

    There are three sheets, Test1, Test2, & Test3. I would like them to be sent to a an existing template. The template thet I provide in thread can be used as an example.

    I used your code:


    Please Login or Register  to view this content.
    The sheets successful copied over to the template as images. However, the image is some how "cropped" or "cut off" Therfore, all of the data is not appearing on in the image.

    Now, when you gave this code:

    Please Login or Register  to view this content.
    The image was not "cropped" nor "cut-off". Everthing copied all of the data in the image. This was done be specifiying Range("b2:Q26").

    So, with attachment Create PowerPowwer(attempt1).xls what needs to be revised in order to get the entire range to copy of over the existing PowerPoint?

  19. #19
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    Please help.

  20. #20
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Copy All Sheets to an Existing PowerPoint Template

    NaNaBoo,


    This is what I came up with I hope it's what you want. As you know I do not have knowledge about PP. I just modidified the code to the best of my knowledge.
    You may have to change the Template path. I made as this workbook path.
    Attached Files Attached Files
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  21. #21
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    I am not sure that we are on the same page. What you mean by a Template is probably not what I mean. A template in a powerpoint to me means in PowerPoint, File > New > Form Design Template.

    Maybe you mean a file as a Template? If so, use FileCopy and copy a pre-made PPT and use that filename for the button1 method.

    The button2 method code that I posted previously, #17, inserts the Excel usedranges to an ActivePresentation.

    So, the 2 methods are button1, open an existing PPT file and button2, fill an active PPT file that is open already.
    Last edited by Kenneth Hobson; 04-07-2009 at 09:39 PM.

  22. #22
    Registered User
    Join Date
    03-16-2009
    Location
    California, USA
    MS-Off Ver
    Excel 2003
    Posts
    98

    Re: Copy All Sheets to an Existing PowerPoint Template

    After the images are transferred over the to PowerPoint Presentation sucessfully. However, once the user minmizes the PowerPoint presentation, they receive a error message at this point in the code. The particular problem is highlighted with red font




    Please Login or Register  to view this content.
    The error message is: Object variable or With block variable not set

  23. #23
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Copy All Sheets to an Existing PowerPoint Template

    You would not see an error caused by a Minimize of PPT. It might have already occurred.

    I tested your files from post #14 with the code from my #17 post and no error occurred.

    You can comment out the line that calls those routines and use the UsedRange:
    Please Login or Register  to view this content.

  24. #24
    Registered User
    Join Date
    08-06-2012
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Copy All Sheets to an Existing PowerPoint Template

    Hi Kenneth,



    I came across a forum where you provided help on VB codes for exporting data from Excel to PowerPoint.


    I am wondering if you could provide me some assistance with my particular quandary.

    I've attached an excel file with code which exports data to PowerPoint.

    The code currently exports the excel data to new slides at the end of my existing PowerPoint file. I would rather the export commence on slide 1 of my PowerPoint file and then continue to populate the existing slides I already have,i.e ranges 1, 2 & 3 get exported to slides 1, 2 and 3 respectively (I have 65 ranges to export to their own PowerPoint slide, resulting in 65 PowerPoint slides).

    Are you able to help?

    Cheers,
    Richard
    Attached Files Attached Files

  25. #25
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy All Sheets to an Existing PowerPoint Template

    Rick_tiger,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  26. #26
    Registered User
    Join Date
    01-24-2013
    Location
    Massachusetts, USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Copy All Sheets to an Existing PowerPoint Template

    I have the macro( see below ) that copies the excel ranges as pictures to powerpoint. I have also assign the powerpoint template, however, the macro is adding new slides to the template, which i don'T WANT. I want to insert the excel pictures in there respective slide in the powerpoint point template. Any help is appreciated.


    Please Login or Register  to view this content.
    Last edited by arlu1201; 01-31-2013 at 09:53 AM.

  27. #27
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copy All Sheets to an Existing PowerPoint Template

    uttamad,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature below this post.

    Also,

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.

  28. #28
    Registered User
    Join Date
    01-24-2013
    Location
    Massachusetts, USA
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Copy All Sheets to an Existing PowerPoint Template

    sorry, I will folow the rules from next time.

    Thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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