I hate to keep posting Excel questions but I have another question. I'm trying to open an Excel template that contains two worksheets and one or more charts. I want to be able to take the charts and load the chart name and variables in a treeview. I can get the chart names into the parent nodes but I'm having trouble getting the Variables associated to each chart. I've tried using the seriescollection but something just isn't right.

I guess my question is how can I determine the variables in an Excel charts series?

Below is what I have. The "var =" line is where my troubles begin.

vb Code:
  1. Public Function GetCharts() As TreeNode
  2.         Dim parentNode As TreeNode = Nothing
  3.         Dim var As String = ""
  4.         Dim i as Integer = 1
  5.  
  6.         For Each oCht As Excel.Chart In oExcel.Workbooks(1).Charts
  7.  
  8.             parentNode = New TreeNode(oCht.Name)
  9.             Do
  10.                 var = CType(oCht.SeriesCollection, Excel.SeriesCollection).Item(i).Name
  11.                 i += 1
  12.                 parentNode.Nodes.Add(var)
  13.             Loop While var <> ""
  14.  
  15.         Next
  16.  
  17.         Return parentNode
  18.  
  19.     End Function