M
Marek
Hi
I'm using C# to late bind to Excel and all is working well except when I
attempt to get the text associated with a comment (range.Comment.Text in VBA
terms).
The code looks like this
object objComment = ExcelWrapper.GetProperty(objRange, "Comment");
if (objComment != null)
{
try
{
object objText = ExcelWrapper.GetProperty(objComment,
"Text");
where GetProperty is implemented as follows:
public static object GetProperty(object targetObject, string
propertyName)
{
return targetObject.GetType().InvokeMember(propertyName,
BindingFlags.GetProperty, null, targetObject, null);
}
The problem is that when the Text property of the Comment object is
retrieved, the call returns with DISP_E_UNKNOWNNAME. I've tried to invoke a
get_Text method and that yields similar results.
Please can anyone help?
Best regards
Marek
I'm using C# to late bind to Excel and all is working well except when I
attempt to get the text associated with a comment (range.Comment.Text in VBA
terms).
The code looks like this
object objComment = ExcelWrapper.GetProperty(objRange, "Comment");
if (objComment != null)
{
try
{
object objText = ExcelWrapper.GetProperty(objComment,
"Text");
where GetProperty is implemented as follows:
public static object GetProperty(object targetObject, string
propertyName)
{
return targetObject.GetType().InvokeMember(propertyName,
BindingFlags.GetProperty, null, targetObject, null);
}
The problem is that when the Text property of the Comment object is
retrieved, the call returns with DISP_E_UNKNOWNNAME. I've tried to invoke a
get_Text method and that yields similar results.
Please can anyone help?
Best regards
Marek