Excel Interop - Add a new worksheet after all of the others

前端 未结 4 430
天命终不由人
天命终不由人 2020-12-15 16:17

I am trying to add a new worksheet to an Excel workbook and make this the last worksheet in the book in C# Excel Interop.

It seems really simple, and I thought the b

4条回答
  •  有刺的猬
    2020-12-15 16:37

    it works for me

    WorkBook.Worksheets.Add(
        System.Reflection.Missing.Value,
        WorkBook.Worksheets[WorkBook.Worksheets.Count], 
        1, 
        System.Reflection.Missing.Value);
    

提交回复
热议问题