title: Excel VBA array data source for Chartspace in Userform
body: <p>I try to generate a barchart within an Excel <code>Userform</code> - <code>Chartspace</code> Is there any possibility to use VBA generated array data as source for the bar chart. I can only find description for <code>Spreadsheet</code> as source.</p>
  
  <pre><code>Private Sub UserForm_Activate()
  Dim z As Long, s As Integer
  Dim cc
  Dim ch1
  Dim pt
  For z = 1 To 9
    For s = 1 To 2
      Spreadsheet1.ActiveSheet.Cells(z, s) = Sheets("Tabelle1").Cells(z, s)
    Next
  Next
  
  Set cc = ChartSpace1.Constants
  Set ChartSpace1.DataSource = Spreadsheet1  '&lt;-- does it need linked to a spreadsheet?
  Set ch1 = ChartSpace1.Charts.Add
  ch1.Type = cc.chChartTypeLineMarkers
  ch1.SetData 1, 0, "A2:A9"
  ch1.SeriesCollection(0).SetData 2, 0, "B2:B9"
  End Sub
  </code></pre>
  
  <p>Is the a other way to show a bar chart in a userform where I can use the array source?
  Thanks a lot.</p>