I would like to perform drag drop from my winform into Excel. For example, holding a button (or a line in DataGridView) in Winform and drag and drop it into an Excel cell will perfom some action or write some data into the Excel cell.
I am talking about drag drop between winform and Excel, not between winform components.
I remember seeing an example once but could not find it again on Google.
Update: Following answer by Avantol13,
How do we extract the object being sent over to Excel ? In the example, it's kind of a hack to let the string be written into the cell, then check that cell's content to perform further action. Perhaps something similar to DragDrop event where we can extract data being sent from e.Data.GetData(e.Data.GetFormats()[0])
Besides, using Application_SheetChange to know the drop event will cause it to loop as Application_SheetChange -> code that modifies the cell, as in the example (delete the cell and write something new) -> trigger again Application_SheetChange, etc.
Thanks in advance.