How to access methods in ThisAddin.cs file

Viewed 6102

I have created an Excel Addin project in C#. Now the solution contains a file ThisAddin.cs, which has a class ThisAddin. Later I have added an item called Form to the same solution. In Form, when I click on a button, for that button click event i want to call a method inside ThisAddin.cs file.

namespace ExcelAddIn
{
    public partial class ThisAddIn
    {
        public void RefreshExcelData()
        {
        }
    }
}

Now in MyForm.cs, while trying to create an object for ThisAddin class there is a compilation error that Thisaddin class doesn't have a constructor that takes 0 arguments.

private void btnUploadTestCases_Click(object sender, EventArgs e)
{
    ThisAddIn objrefresh = new ThisAddin();
}

What am I missing here?

2 Answers
Related