View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jdub765 jdub765 is offline
external usenet poster
 
Posts: 3
Default Chart Position in VB6

I'm working in TestPartner, an automation tool that uses VB6, and I either
need to reposition a chart, or change the default position. I've been
searching to find a solution, but I can't seem to get it to work...

I found this link
http://msdn.microsoft.com/newsgroups...=en-us&m=1&p=1
and I think I need to use this code:

With ActiveSheet.Shapes("Chart 1")
.Left = ActiveCell.Left
.Top = ActiveCell.Top
End With

I don't know how to use the code above in my code below...

Private Sub GenerateGraph(objChart As Excel.Chart)
objChart.ChartType = xlPie
objChart.SetSourceData source:=objSheet.Range("B4:C5"), PlotBy _
:=xlColumns
objChart.location Whe=xlLocationAsObject, name:="Graph"
End Sub

Any help is greatly appreciated!