我花了很多時間尋找所有C API XLM函數的完整文檔,但都沒有成功。缺少MSDN文檔來開發xll add ins?
我發現這個網頁,其中說明了其中的幾個: http://msdn.microsoft.com/en-us/library/office/bb687910%28v=office.12%29.aspx
但是比如我想了解和使用xlfAddMenu,我不能找到MSDN一個頁面,給我解釋一下。
您是否知道是否有任何文檔可用?顯然,到達那裏並不容易。
我花了很多時間尋找所有C API XLM函數的完整文檔,但都沒有成功。缺少MSDN文檔來開發xll add ins?
我發現這個網頁,其中說明了其中的幾個: http://msdn.microsoft.com/en-us/library/office/bb687910%28v=office.12%29.aspx
但是比如我想了解和使用xlfAddMenu,我不能找到MSDN一個頁面,給我解釋一下。
您是否知道是否有任何文檔可用?顯然,到達那裏並不容易。
沒有針對所有C API XLM函數的詳盡官方文檔。然而,隨着documentation說以下有關C API XLM功能:
還有更多的功能由Excel中通過C API,當你正在開發XLLs是有用 暴露。它們對應於Excel工作表 函數和函數和命令都可以從XLM宏 表。」
此外,EXAMPLE.[C,H]
文件與安裝SDK的COMME使用其中的一些功能,你可以使用它來學習如何使用它們例如,xlfAddMenu
在xlAutoOpen
回調函數中使用
// In the following block of code, the Generic drop-down menu is created.
// Before creation, a check is made to determine if Generic already
// exists. If not, it is added. If the menu needs to be added, memory is
// allocated to hold the array of menu items. The g_rgMenu[] table is then
// transferred into the newly created array. The array is passed as an
// argument to xlfAddMenu to actually add the drop-down menu before the
// help menu. As a last step the memory allocated for the array is
// released.
//
// This block uses TempStr12() and TempNum12(). Both create a temporary
// XLOPER12. The XLOPER12 created by TempStr12() contains the string passed to
// it. The XLOPER12 created by TempNum12() contains the number passed to it.
// The Excel12f() function frees the allocated temporary memory. Both
// functions are part of the framework library.
Excel12f(xlfGetBar, &xTest, 3, TempInt12(10), TempStr12(L"Generic"), TempInt12(0));
if (xTest.xltype == xltypeErr)
{
hMenu = GlobalAlloc(GMEM_MOVEABLE,sizeof(XLOPER12) * g_rgMenuCols * g_rgMenuRows);
px = pxMenu = (LPXLOPER12) GlobalLock(hMenu);
for (i=0; i < g_rgMenuRows; i++)
{
for (j=0; j < g_rgMenuCols; j++)
{
px->xltype = xltypeStr;
px->val.str = TempStr12(g_rgMenu[i][j])->val.str;
px++;
}
}
xMenu.xltype = xltypeMulti;
xMenu.val.array.lparray = pxMenu;
xMenu.val.array.rows = g_rgMenuRows;
xMenu.val.array.columns = g_rgMenuCols;
Excel12f(xlfAddMenu,0,3,TempNum12(10),(LPXLOPER12)&xMenu,TempStr12(L"Help"));
GlobalUnlock(hMenu);
GlobalFree(hMenu);
}
據我最好的文檔(但不更新..)是下面的書籍:。用Excel財務應用C/C++中的插件開發,第2版史蒂夫道爾頓。你可以在Microsoft Excel XLL軟件開發工具包的chm文件中找到一些有用的信息,包括代碼示例(注意:我沒有在其中找到xlfAddMenu,所以我想它是一個折舊功能)。