Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

XLL in C equivalent of VBA ActiveSheet.Cells

20 views
Skip to first unread message

Ai

unread,
May 12, 2010, 4:34:18 AM5/12/10
to
VBA code:

With ActiveSheet
...
.Cells(row, col) = "Update"
...
End With

I found there the equivalent is xlSet but it does not work as
mentioned in http://msdn.microsoft.com/en-us/library/bb687835.aspx

Also is there anyway to set the caller cell to wrap text if my UDF in
the xll return a native data type char* with multiple newline?

Please advise.

Ai

unread,
May 13, 2010, 1:25:45 AM5/13/10
to
On May 12, 4:34 pm, Ai <abun...@gmail.com> wrote:
> VBA code:
>
> With ActiveSheet
>                 ...
>                 .Cells(row, col) = "Update"
>                 ...
> End With
>
> I found there the equivalent is xlSet but it does not work as
> mentioned inhttp://msdn.microsoft.com/en-us/library/bb687835.aspx

>
> Also is there anyway to set the caller cell to wrap text if my UDF in
> the xll return a native data type char* with multiple newline?
>
> Please advise.

I reference the example code from http://msdn.microsoft.com/en-us/library/bb687826.aspx:

short WINAPI xlSetExample(short int iVal)
{
XLOPER xRef, xValue;

xRef.xltype = xltypeSRef;
xRef.val.sref.count = 1;
xRef.val.sref.ref.rwFirst = 204;
xRef.val.sref.ref.rwLast = 205;
xRef.val.sref.ref.colFirst = 1;
xRef.val.sref.ref.colLast = 1;
xValue.xltype = xltypeInt;
xValue.val.w = iVal;
Excel4(xlSet, 0, 2, &xRef, &xValue);
return 1;
}

This function is call from a thread but the worksheet freezes
immediately after calling the excel function. Any idea why?

0 new messages