Beispiel #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     if (TAG == "xll")
     {
         string s = listBox1.SelectedItem.ToString();
         Console.WriteLine(s);
         MyExcelFunctions.RemoveXllMacro(s);
     }
     else if (TAG == "com1" || TAG == "com2")
     {
         string            s   = listBox1.SelectedItem.ToString();
         Excel.Application app = ExcelDnaUtil.Application as Excel.Application;
         dynamic           list;
         if (TAG == "com1")
         {
             list = app.AddIns;
         }
         else
         {
             list = app.AddIns2;
         }
         foreach (dynamic j in list)
         {
             if (j.FullName == s)
             {
                 File.Delete(j.FullName);
             }
         }
     }
     LoadList();
 }