View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.powerpoint
John Wilson[_3_] John Wilson[_3_] is offline
external usenet poster
 
Posts: 1
Default Excel to Powerpoint 2003 Chart Width

Does setting
shp.LockAspectRatio=msoFalse
before you set the width help?
--
john ATSIGN PPTAlchemy.co.uk

Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoi...tutorials.html
PPTLive Atlanta Oct 11-14 2009




"Robert" wrote:

Hello All...

I built a tool designed to push All or Selected Charts and
ChartObjects directly to PowerPoint. The code below is for
ChartObjects and works great (charts are properly formatted within the
slide) in 2007 (Office12) but not in 2003. In 2003, the width of the
chart extends off the right slide of the slide. I added the debug
lines and modified the Width calc but in each case the width value is
off the slide - which is strange because the math is straightforward.
I recall some info about 2003 to 2007 Ppt changes but have not been
able to track them down. Thanks for any help...

-Robert

For Each chtobj In Sheets(n).ChartObjects
sld_count = sld_count + 1
chtobj.Copy
Set PPSlide = ppPres.Slides.Add(Index:=ppPres.Slides.Count + 1,
Layout:=ppLayoutBlank)
PPSlide.Select
'// Paste the chart/shape
PPSlide.Shapes.Paste
Set shp = PPSlide.Shapes(1)
With ppPres.PageSetup
shp.Left = frmPpt.TextBox1.Value * 75
shp.Top = shp.Left
'// SlideWidth does not calc as expected
shp.Width = .SlideWidth - (shp.Left * 2)
shp.Height = .SlideHeight - (shp.Top * 2)

Debug.Print "left: " & shp.Left
Debug.Print "top: " & shp.Top
Debug.Print "width: " & shp.Width
Debug.Print "height: " & shp.Height
Debug.Print "--------"
End With
'// Add TextBoxes
AddTextbox
Next