Embedded Excel worksheet's size changed after double-clicking in P

F

fmamstr

Hi there,

Currently we are programmatically copy/pasting something(grid, live
chart) from Excel into PowerPoint as an embedded workbook and we modify the
original size so that the pasted result will be appropriate to be placed into
PowerPoint.

We have achieved the functionality as above, but we meet some problems
when user double clicking on that embedded excel worksheet. After double
clicking , the user return to the slide, we find that the "embedded
worksheet" size changed.

Some conditions required for this problem to happen:
1. This only happens in Office 2007.(Excel 2007, PowerPoint 2007).
2. This only happens when want to embed a "live chart" into PowerPoint
slide, but there is no such problem for embedding a "grid".

We create the "Live Chart†and manipulates its size by the code below:

Excel.Chart _chart =
(Excel.Chart)_workbook.Charts.Add(_missing, _missing, _missing, _missing);
_chart.PageSetup.ChartSize =
Microsoft.Office.Interop.Excel.XlObjectSize.xlScreenSize;
_chart.ChartArea.Width = width; // Specified width
_chart.ChartArea.Height = height; // Specified height

The "paste" code is below:

_app.Selection.Range.PasteSpecial(ref missing, ref link, ref placement, ref
displayAsIcon, ref dataType, ref missing, ref missing);

The data type is "OleObject".

Can anyone help on this problem? Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top