C# Interface with Excel

Mar 27 2012 9:50 PM
 
Dear All,
Season Greetings,

Experts help needed,

1. when we run C# windows forms on that button click I need to select a Excel cell by user click on run time,

from this sample,

Excel.Range myCell = (Excel.Range)xlWorkSheet.get_Range("E4", "E4");

instead of giving Range ("E4", "E4") let user should click by his own on the run time,

how to pause for user click on runtime, from C# to excel?

Once he clicks we need to get the cell value for further calculations on C#.

Could you please help me.

2. when I open an excel file thro. C# its working fine, but when I need to save & close,

the error i got is file already existing need to over write or not??

sample code,

xlWorkBook = xlApp.Workbooks.Open(filename, 0, true, 5, "", "",

true

"\t"

xlWorkBook.Close(true, misValue, misValue);

best regards,

Jawahar.

xlApp.Quit();

, false, false, 0, true, 1, 0);
, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows,