Click here to Skip to main content
15,894,410 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C++
#define rgFuncsRows 1
#define rgArguments 11

static LPSTR rgFuncs[rgFuncsRows][rgArguments] =
{
	//	function title, argument types, function name, arg names, type (1=func,2=cmd),
	//		group name (func wizard), hotkey, help ID, func help string, (repeat) argument help strings

	{" AccChk",	" RRR",	" AccChk",	" loper,roper",	" 2",
	" 对账插件",	" ",
	" ",
	" 对比loper和roper,将loper在roper中不存在的作为结果",
	" 目标列",
	" 对比列 "
	}
};

and I register this function like this:
C++
Excel4v( xlfRegister, &xConfirm, j+1, (LPXLOPER FAR *) &pParas[0] );

this function is defined here :
C++
XLLFIN_API LPXLOPER AccChk( LPXLOPER ld,LPXLOPER rc )
 {
     XLOPER12 xRef, xValue;

     xRef.xltype = xltypeSRef;
     xRef.val.sref.count = 1;
     xRef.val.sref.ref.rwFirst = 2;
     xRef.val.sref.ref.rwLast = 5;
     xRef.val.sref.ref.colFirst = 5;
     xRef.val.sref.ref.colLast = 7;
     xValue.xltype = xltypeNum;
     xValue.val.num = 323;
     int rv = Excel12(xlSet, 0, 2, (LPXLOPER12)&xRef, (LPXLOPER12)&xValue);
     return NULL;
 }

and in excel 2010 ,I insert a MS Excel 4.0 macro sheet,and select a cell and edit its funtion =AccChk(A1:A9,B1:B7) but the function didn't work, the required rectangle area is empty.My target is writing an array of values into excel work sheet or macro sheet,what should I do?Thanks for your help!
Posted
Updated 23-Oct-19 16:44pm

1 solution

This may be too late, but..

xlSet does not work in a worksheet function. It can only be used in a so-called Command function, which in my experience, is usually invoked via a Menu.

If you could describe what exactly you want to do, there may be another way of achieving the objective..
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900