Hi,
I am using the single Excel app object through out in my application. I used the SetParent API to fit the excel in the window. When I first access the object and open the workbook, it work fine and the focus remains on the workbook.
I closed the window by closing the workbook and reset its parent. When I open it at the second time, focus will lost from the window and I do nothing on the workbook.
I used SetForegroundWindow API, activate method but it does not work.
I am sending the code, that I am using:-
System.Threading.Thread.CurrentThread.CurrentCultu re = New System.Globalization.CultureInfo("en-US")
mxlBook = goExcel.ExcelApp.Workbooks.Open(gsFldrStock & "temp\table\" & excelfilenameWithPath)
System.Threading.Thread.CurrentThread.CurrentCultu re = oldCI
goExcel.ExcelApp.Visible = True
fraExcel.Visible = True
goExcel.SetAppSize(fraExcel, 0, True)
goExcel.SetParent(fraExcel.Handle.ToInt32)
Thanks in advance.