View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ker_01 Ker_01 is offline
external usenet poster
 
Posts: 100
Default Updating "active window" in Embedded Excel OLEObject in PowerP

Barb- you don't mention which version of Excel and Powerpoint you are using;
if I recall correctly, I believe I've read posts indicating that the 2007
powerpoint object model is less exposed for coding than the 2003 and earlier
versions, but I haven't coded in 2007 so I can't personally confirm this.

I believe the code you require will be controlling Powerpoint itself, and if
you need to call it from Excel you'll have to link to powerpoint (plenty of
info online about cross-application automation within the Office programs).
I recorded a short macro resizing an embedded Excel window in powerpoint
(below) but I think you'll have more luck getting syntax help in one of the
office automation newsgroups or in the powerpoint newsgroup.

'powerpoint VBA
Sub ExcelResizer()
ActiveWindow.Selection.SlideRange.Shapes("Object 29").Select
ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=1
End Sub

If you search for "objectverbs" in powerpoint VBA help it has a code snippet
to identify all available doverb commands for a selected shape.

Once you've got the code working within powerpoint, it should be easy to use
late binding to replicate the same functionality within Excel if desired.

Hope this helps,
Keith

"Barb Reinhardt" wrote in message
...
I know how to do everything you say manually. I need to know how to do it
programmatically? Can the Excel Subwindow be resized programmatically?
If
so, how?
Thanks,
Barb Reinhardt




"ker_01" wrote:

Barb-

If I understand your question correctly... it sounds like you want to
manually eliminate blank visible rows in powerpoint. If you are trying to
do
this via code, please post the code you have come up with so far.

For manual correction, when you 'open'/select the worksheet object in a
powerpoint slide, you will see scrollbars that allow you to move around
to
cells that weren't visible before. When you exit the excel object (revert
focus to powerpoint) whatever was visible in the Excel subwindow is what
is
shown in powerpoint. Therefore, with the Excel subwindow open, move to
your
target range, then use the window 'handles' to resize the subwindow to
hide
any undesired rows. When you click out of the Excel subwindow, those
extra
rows will be gone.

You can then resize the Excel container within Powerpoint to take
advantage
of any extra space this gives you.

Hope this helps,
Keith


When you embed an Excel sheet in powerpoint,
"Barb Reinhardt" wrote in
message
...
I've added a bunch of data to several embedded OLEObjects in
PowerPoint,
but
now I find that when I view the presentation, there are blank rows
displayed.
How do I change the "view" so that those blank rows are no longer
displayed.

The objects are referrred to as myShape, and I can figure out the last
row
that I want to display in the object.

Thanks,

Barb Reinhardt