Pasting from Excel

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I'm using PowerPoint 2003 and Excel 2003. Each month a diagram needs to be
copied into the presentation replacing the last version. Manually I can
delete the old version, this leaves the placeholder on the screen (but in a
random position with a random size). Then copy the required cells from Excel
and finally pastespecial into the placeholder. Then it needs to be resized.
There are many such replacements so I want to automate the process. The idea
is to select the item to be replaced, copy the new one into the clipboard
then have the macro do the rest. The VBA macro will get the top, left, width
and height from the currently selected item, delete it then pastespecial the
item from the clipboard and finally resize it to the same as the original
deleted item. This doesn't work as for some reason all dimensions are able to
be resized except the height, it won't budge. I've tried a variety of things
and they all have similar side effects. I can do everything I want just not
all at the same time! Any guidance would be appreciated.

thanks, Orangeutan
 
When pasting in your Excel item, have you tried using PASTE SPECIAL and then
selecting LINK instead of just pasting it into the presentation?

--

Bob Larson
Super Moderator - Access World Forums
Access VIP on Utter Access
____________________________________
Access 2000, 2003, 2007, SQL Server 2000, Crystal Rpts 10/XI, VB6
WinXP, Vista
 
Hi Bob,

Thanks for your answer. Looks like I 'lied' in my original question, I'm
only using PP 2002 not 2003. In answer to your suggestion, they don't want
the data linked as they distribute the presentation quite widely as a single
file. I think I can better express the question now too.

All I really need to be able to do is remove the top item from the office
clipboard and my solution will work. You can do that manually but it doesn't
record (in fact you can delete any given item) so I figured it had to be
available via a windows API but had no luck in finding that. All I found was
old whole clipboard get/clear.

So the plan is to copy the new table from excel into the clipboard, then
switch to last month's powerpoint, select the old table then press an icon
button to run the macro. The macro will grab left, top, width and height of
the current window, cut the selected item (this leaves the placeholder but
sticks the cut item on top of the clipheap), remove it from the office
clipboard, leaving the new one to be 'pastespecial' onto the PP slide and
then resized and positioned using the original dimensions. The only flaw in
the plan is that at the moment it pastes back the original as it's on top of
the clipboard. Leaving the placeholder there removes all the weird issues re
inability to resize some aspects etc, it all just works, well except for the
clipboard part :(

My least preferred solution is to do the cut, writing off the position and
size somewhere then do the paste using the written out dimensions and finally
delete the .ini/slide whatever was used to temporarily store the dimensions,
maybe even public variables would work here. I hope I've explained the
problem a bit better this time.

Sorry for the poor initial description.

OrangeUtan
 
Back
Top