locked
Excel 2016 version Issues in application RRS feed

  • General discussion

    1. Open excel application into window tab fitted .

    Open Word doc into below tab , comparing excel to doc , once comparison is completed , we click on the changes it redirects to the specific location mismatchesin both Excel and Word .    

    Working fine up to Excel 2010 version in application as follows :

    1. When it excel bind into window tab control where we are creating

          i.one instance for Excel.ApplicationClass

    ii. SetParent

    iii. workbookopen

    iv.activatesheet

    v.And set into excel into tabcontrol

    vi.comparing excel and word

    vii. it holds the sidepanel the mismatches in word and excel

    viii.when click on mismatch word in side panel it redirects to both mismatch location in both excel and word

    this is the requirement

     2. It works fine  in comparison with excel to word and sheet is active and editable.

    No issues we faced like  in excel 2016 version like

              i.deactive sheet first excel ,after opening multiple excels in window tab control

    ii. no editing in excel

    iii. no autoscroll working for given range selected. 

    Issues faced  for same above code in Excel 2016 version :<o:p></o:p>

    Previous code<o:p></o:p>

    1. Same as above steps , the code is as below

    //creating instance for ApplicationClass

    excelApp = new Excel.ApplicationClass();

          //Get the application handler

     [DllImport("user32.dll")

     public static extern int FindWindow(string strclassName, stringstrWindowName);

     

     ExcelWnd = FindWindow("XLMAIN", excelApp.Caption);

     excelApp.Caption = null;

     

     excelApp = new Excel.ApplicationClass();   //creating instance second time ; because object reference error at  wbook after setting SetParent happened

     

    SetParent(ExcelWnd, this.Handle.ToInt32());

     

    wbook = excelApp.Workbooks.Open(filename, 0, readOnly, Type.Missing, """",false,    Excel.XlPlatform.xlWindows, ""truefalse, 0, truefalse,false);

     

    excelApp.EnableEvents = true;

    wsheet.Activate();

    wbook.Activate();

     

    The excel is coming outside the window tab control.

    We fixed the above issue for excel 2016 version as follows  but still auto scroll and range cell in excel is not working::<o:p></o:p>

    After modify code : <o:p></o:p>

    //creating instance for ApplicationClass

    excelApp = new Excel.ApplicationClass();

          //Get the application handler

     [DllImport("user32.dll")

     public static extern int FindWindow(string strclassName, stringstrWindowName);

     

     ExcelWnd = FindWindow("XLMAIN", excelApp.Caption);

     excelApp.Caption = null;

     

     //removed the second excel.ApplicationClass instance here as in above

     //placed SetParent at last

     

    wbook = excelApp.Workbooks.Open(filename, 0, readOnly, Type.Missing, """",false,    Excel.XlPlatform.xlWindows, ""truefalse, 0, truefalse,false);

     

    excelApp.EnableEvents = true;

    wsheet.Activate();

    wbook.Activate();

    SetParent(ExcelWnd, this.Handle.ToInt32());

    Now output is showing like as expected fitted in window tab 

    After setting Setparent in Last , later the excel is deactivate , not editing in excel,no auto scroll for select range in execel

    Note:

    1. Here we are facing I'm embedding excel into the window tab control using the setParent() method in only excel 2016 version.
    2.   If I'm not embedding into any control or just try open an excel outside the control the range activate its working fine.
    3. So is that any problem in the setParent() method for excel 2016 or any workaround needs to be done for it?

    Please help me out for this issue..

    Thanks in advance


    • Edited by Kiran Reddi Friday, December 22, 2017 2:31 PM
    Friday, December 22, 2017 12:34 PM