How to make Windows Form as a Child Form of Excel App IN C#

0

I'm creating a Windows Form in Excel Workbook AddIn App.. I want to make This form a MdiChild Form of Excel Application.. I am Using This Code but i am getting this Error..

Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))"}    System.Runtime.InteropServices.COMException

Added This Class and Implimented the IWin32Window interface

public class WindowImplementation : System.Windows.Forms.IWin32Window
{
   public WindowImplementation(IntPtr handle)
   {
      _hwnd = handle;
   }

    public IntPtr Handle
    {
       get
       {
          return _hwnd; 
       }
    }

    private IntPtr _hwnd;
}

Then used this following code to get form shown specifying the parent Excel

//window handle
UserForm u = new UserForm();
u.Show(new WindowImplementation(new IntPtr(Globals.ThisAddIn.Application.Windows[1].Hwnd)));
c#
excel
asked on Stack Overflow Sep 20, 2019 by Dileep Singh • edited Sep 20, 2019 by micharaze

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0