I have 2 applications: one is based on a WPF DataGrid and the other is an Excel AddIn.
My goal is to pass data, via Clipboard, from the former to the latter.
I have no problem copying tab-separated, cuadriculated data into the regular Excel "Paste" operation. Additionally, I implemented my own "Smart Paste".
My trouble began when I decided to copy+paste a more complex object. I marked all my classes as [Serializable] and have a method that makes sure that the object can be serialized. In fact, the whole operation works perfectly provided that the pasting app is NOT the Excel AddIn.
The passed object is of a class named Engineering.Export.Exported. As we can see, the clipboard looks fine:
See the 3 relevant statements. They are identical in both applications.
The last assignment fails only in the application where I need it.
I have tried many combinations, for instance GetData("ExportFormat") but the result is the same.
Any tips, suggestions are very welcome.
TIA
Addition:
I prepared a super-simplistic object:
namespace Engineering
{
[Serializable]
public class SimpleStuff
{
public string Greetings;
public int GraduationYear;
public bool Available;
}
}
and the problem remains: I can export it into any application except a VSTO AddIn. The last statement always returns null, inside AddIns.
Exported
(or the test caseSimpleStuff
) is defined? Does it link to the actual library where the type is defined? Some other mechanism e.g. a COM type library? - Eric J.