SoFunction
Updated on 2025-03-06

Analyze the method of closing after C# operation excel


using   ;  

  [DllImport("",   CharSet   =   )]  
  public   static   extern   int   GetWindowThreadProcessId(IntPtr   hwnd,   out   int   ID);  
  protected   void   Button1_Click(object   sender,   EventArgs   e)  
  {  
         excel   =   new   ();  
      ("d:\",   ,   ,   ,   ,   ,   ,   ,   ,   ,   ,   ,   ,   ,   );  
      IntPtr   t   =   new   IntPtr();  
      int   k   =   0;  
      GetWindowThreadProcessId(t,   out   k);  
         p   =   (k);  
      ();                  
   }