View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jon Peltier[_10_] Jon Peltier[_10_] is offline
external usenet poster
 
Posts: 17
Default Anchoring a chart to a certain area

When you create the chart, don't use Workbooks("Book1.xls").Charts.Add, use

Workbooks("Book1.xls").Worksheets("Sheet1").ChartO bjects.Add _
(Left, Top, Width, Height)

where Left etc., allow you to specify a precise location and size for the
chart object, in points. To have a chart cover the range "B2:F15", use
something like this:

With Workbooks("Book1.xls").Worksheets("Sheet1").Range( "B2:F15")
Workbooks("Book1.xls").Worksheets("Sheet1").ChartO bjects.Add _
(.Left, .Top, .Width, .Height)
End With

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______


"enak" wrote in message
...

I don't know how much more detail I can provide than what I have already
provided. Please read my first post. I need to be able to put the charts
at certain locations on the spreadsheet.

I have tried to create a macro and then use that code to put in my code
but I get errors when I run it.

How can I put the chart at a certain location (anchore it to a cell) in
the spreadsheet. I am trying to do this through vb.net code in a windows
application.


--
enak
------------------------------------------------------------------------
enak's Profile:
http://www.excelforum.com/member.php...o&userid=28650
View this thread: http://www.excelforum.com/showthread...hreadid=483152