title: chartArea position properties don't work in vba Excel 2013
body: <p>I'm noob in vba (Excel macros). I need to add somes charts automatically in the same WorkSheet. This is my code:
  </p>
  
  <pre><code>Sub runChart()
      Dim xchart As Chart
      Dim nameSheet As String
      nameSheet = ActiveSheet.Name
      Dim x As Integer
      Dim firstIndex As Integer
      Dim firstValue As Integer
      Dim actualValue As Integer
      Dim actualIndex As Integer
      Dim rChart1 As Range
      Dim rChart2 As Range
      MsgBox nameSheet
      firstIndex = 2
      actualIndex = 2
      firstValue = Cells(2, 1)
      actualValue = Cells(2, 1)
      Do
         Do
             actualIndex = actualIndex + 1
             actualValue = Sheets(nameSheet).Cells(actualIndex, 1)
         Loop Until firstValue &lt;&gt; actualValue
  
         Set rChart1 = Range(Sheets(nameSheet).Cells(firstIndex, "E"),      Sheets(nameSheet).Cells(actualIndex - 1, "E"))
         Set rChart1 = Union(rChart1, Range(Sheets(nameSheet).Cells(firstIndex, "J"), Sheets(nameSheet).Cells(actualIndex - 1, "J")))
         Dim nameChart As String
         nameChart = CStr(Sheets(nameSheet).Cells(firstIndex, 5)) &amp; " - " &amp; Sheets(nameSheet).Cells(actualIndex, 5) &amp; " " &amp; CStr(Sheets(nameSheet).Cells(firstIndex, 1))
         Set xchart = Charts.Add
         With xchart
              .Name = nameChart
              .ChartType = xlColumnClustered
              .SetSourceData rChart1
              .Location Where:=xlLocationAsObject, Name:=nameSheet
  
               'position and size chart
              .ChartArea.Top = 10 'this position is a example
              .ChartArea.Left = 1700 'this position is a example
              .ChartArea.Height = 400 'this size is a example
              .ChartArea.Width = 750 'this size is a example
          End With
  
          firstValue = Sheets(nameSheet).Cells(actualIndex, 1)
          firstIndex = actualIndex
  
       Loop Until (Sheets(nameSheet).Cells(actualIndex, 1) = vbNullString)
  End Sub
  </code></pre>
  
  <p>So, my problem happens is in .ChartArea.left = 1700. The program says :</p>
  
  <blockquote>
    <p>The specified dimension is not valid for the current chart type</p>
  </blockquote>
  
  <p>anyone has any idea what 's happening? Thanks for your time :)</p>