Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi, can anyone help with a little t 2

Status
Not open for further replies.

LGMan

MIS
Aug 27, 2003
233
0
0
GB
Hi, can anyone help with a little task that I've taken over which is to copy a range of cells from Excel to Powerpoint 2010. The usual sage advice of recording a macro does not apply for PP 2010 as it's not there. So hardly using PP, I'm completly stuck.
I've got 6 slides that I gather a range of cells from 6 worksheets in Excel.
My PP master is already set up with titles etc and is called Daily Plan.ppt

Thanks in advance
 
The easiest way I have done this in the past is to simply copy your cells from Excel and then go into PowerPoint and select, "Paste Special..." I then will paste it as an "Enhanced Metafile". You will notice that when you do this, sometimes the borders from Excel get copied over. If you want to get rid of the borders, then go back into Excel, change the border color to white, and recopy the data and paste special as shown above. The nice thing doing it this way is that you are able to stretch the cells to be as large or small as you want with minimal distortion.
 


LG,

Is this a ONE TIME thing or a DAILY, as the name implies, task?

Are you copying OBJECTS or RANGES"

How are the target ranges/objects defined for each sheet?

If this is a recurring task, I'd be apt to LINK the ranges/objects to the workbook and then code, updating the data in Excel. This COULD be recorded and would be much simpler to implement. The simply update links in PP.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi Skip, it's a job that I do 5 days a week, the powerpoint presentation gets emailed out to about 15 guys in my organisation. I've got a procedure that builds all the tables within Excel now so that creates my data nice and easy. I was hoping to be able to get some pointers on getting VBA to copy and paste the cell ranges, rather than me doing it manually.
On a Monday there are 13 slides in the pack, whereas on Tues to Fri, there are only 6.
 

Again, why not LINK the data? No copy/paste in the daily task!

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi LG, not sure how much this will help but if I can put a little back into the community that has helped me so much over the years..

From what I remember I would have opened an Excel workbook that contains Named Ranges that correspond to the named shapes within the PowerPoint slide

I have this in a PowerPoint Module:-

Code:
Sub Slide_5_Get_Data()

    ' Reference existing instance of Excel - using "Template" workbook
    Set xlApp = GetObject(, "Excel.Application")
    
                With ActivePresentation.Slides.Range("Slide 5")

    ONames = Array("xyzTV", "CompetitorTV", "xyzRetail", "CompetitorRetail", "xyzPrint", "CompetitorPrint" _
    , "xyzCampaign", "CompetitorCampaign")
    
        For Each OName In ONames
            Set MyText = .Shapes("TextBox " & OName & "Summary")
            MyText.TextFrame.TextRange = xlApp.Range(OName & "Summary")
        Next OName
        
End With

Set xlApp = Nothing
        
End Sub

I hope this might put you on the right road.

Many thanks,
D€$
 
I agree with Skip.

LGMan it's super simple. It is NOT the method you thought of using, but it WILL deliver the results you want, and be much easier for you and repeatable by others.


From your excel workbook:
Copy the cell range or chart

In powerpoint:
Click on Paste Special (NOT PASTE)
On the left inside that window, select the Paste Link radio button
Click ok
You now have an excel workbook object or chart object in your file, depending on which you pasted in.
The powerpoint file will ask you if it may update that object, along with any changes, as you open the file
You may also manually update the file (different methods depending on your version of powerpoint, but I have faith in you being able to find it)
You may break links before sending the file via email, if you like (this will prevent the powerpoint file from requesting to update as your guys open the file)
- If instead you like them being able to update, and have faith that it will not fail to update, leave the link in.
You only have to link the cells/charts once.
You would have to break links every time you sent the file out, if you were breaking links
You can break links via a macro, if you so choose.
 
Guys, many thanks for the help for both the methods, I like to play around with vba, and always trawl through others questions and take a snippet of knowledge here and there. There's enough VBA in PWDs answer to get me started, cheers for that.
Plus the other suggestions are great to know as I've hardly used PP apart from some naff presentations before, so good to know that's it's a bit more useable.
 
When I'm 'fishing' with code in an application whose object model I am not familiar, or even in one that I am familiar, but with objects that I am not that familiar with, I use the Watch Window to DISCOVER lots of good stuff.

faq707-4594

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hey I'm all for digging into a different way to do things, especially ways that challenge the mind and are good practice for other practical applications.

But I've also been burned quite a bit by insisting on using the more difficult method. When other people need to use my tools, and it's too arcane or complex for the next guy to just plop down and use it, it really doesn't help the organization out.

While I believe that those other people could very well learn all the stuff that I've done, it was rather arrogant to assume that they should have to, simply because that's the way I did it.

I'm not suggesting that you, LGMan, are guilty of the same thing, nor that it's even a concern. For all I know you could be the one guy there who does that sort of thing and that's all there is to it.

Let's just call this "share-able life lessons from your friendly neighborhood Gruuuu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top