Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/324.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# Excel-绑定序列名称_C#_Excel - Fatal编程技术网

C# Excel-绑定序列名称

C# Excel-绑定序列名称,c#,excel,C#,Excel,我是C语言中excel的新手,但我需要从一个范围或单元格值绑定序列名称。以下代码不适用于我。有什么建议吗 Excel.Series serie = seriesCollection.NewSeries(); serie.Name = xlWorkSheet.Range[xlWorkSheet.Cells[1, j], xlWorkSheet.Cells[1, j+1]].Value.ToString(); 我已经解决了这个问题,给出了类似字符串的方程,比如 se

我是C语言中excel的新手,但我需要从一个范围或单元格值绑定序列名称。以下代码不适用于我。有什么建议吗

      Excel.Series serie = seriesCollection.NewSeries();
      serie.Name = xlWorkSheet.Range[xlWorkSheet.Cells[1, j], xlWorkSheet.Cells[1, j+1]].Value.ToString();

我已经解决了这个问题,给出了类似字符串的方程,比如

    serie.Name="=Tabelle1!$A$1" ;
因此,序列名称将自动绑定。对于迭代计算,我使用了这种形式

            foreach (GraphFile file in files)
            {
                int count = file.Points.Count;
                Excel.Series serie = seriesCollection.NewSeries();


                //Bind serie name from excel sheet
                serie.Name = "=" + sheet_name + "!$" + (char)char_Value + "$1";
                char_Value += 2;

            }