Programmatically creating worksheets in an Excel Add In (C#)
问题 According to MSDN, one can programmatically create and delete Excel Worksheets in Visual Studio (http://msdn.microsoft.com/en-us/library/6fczc37s.aspx). The code to do so is as follows: private void createNewAccount() { Excel.Worksheet newWorksheet; newWorksheet = Globals.ThisAddIn.Application.ThisWorkbook.Worksheets.Add(); } One of the forms in my project has a button carrying this code. The user is supposed to be able to press it and create a new worksheet, but it doesn't work. So I decided