xll

XLL Excel addin in unmanaged C++

不打扰是莪最后的温柔 提交于 2019-12-21 03:44:57
问题 I have a few mathematical simulations in unmanaged C++ and now I need to integrate them with Excel (so that it is possible to call the functions from Excel and get the values back). I don't want to use any VBA, so I guess I have to implement an XLL addin. I would like to use as few third party additional frameworks as possible. Could someone point me to a good tutorial? 回答1: Starting out with the SDK can be a bit unpleasant. I'd suggest you try one of the toolkits: XLW (http://xlw.sourceforge

Convert ASCII character to x11 keycode

梦想的初衷 提交于 2019-12-18 06:13:04
问题 I have a small program that takes input in the form of ascii characters. I need to be able to convert these to keycodes for use with x11 functions. Is there a xlib function to do this or another library? Or will a large switch case work best? 回答1: You can use XStringToKeysym to convert to KeySym , followed by XKeysymToKeycode for conversion to KeyCode . Display *display = ...; KeySym sym_a = XStringToKeysym("A"); KeyCode code_a = XKeysymToKeycode(display, sym_a); 回答2: This question has an old

return multi dimension array to excel from c++ xll

会有一股神秘感。 提交于 2019-12-13 04:54:49
问题 This works fine when i try to pass a 1 dimension array __declspec(dllexport) LPXLOPER TestArray() { XLOPER xlValues[2]; xlValues[0].xltype = xltypeNum; xlValues[1].xltype = xltypeNum; xlValues[0].val.num = 123; xlValues[1].val.num = 345; static XLOPER xlArray; xlArray.xltype = xltypeMulti | xlbitDLLFree; xlArray.val.array.rows = 2; xlArray.val.array.columns = 1; xlArray.val.array.lparray = &xlValues[0]; return (LPXLOPER)&xlArray; } But when i try to pass a multi dimension array, the function

Calling an XLL from (unmanaged) C++

时光毁灭记忆、已成空白 提交于 2019-12-13 02:57:49
问题 I have an XLL Excel addin and now another team wants to use the same functionality in their project (unmanaged C++). Is there a way to interface with this XLL directly from C++? 回答1: Is you XLL un managed or unmanaged code? As far as I know, an unmanaged C++ XLL file is in fact a DLL that exports specific methods called by Excel. If your XLL has a .def file, maybe you could add method that would be called by the other team. 回答2: You can use GET.WORKSPACE(44) to get a list of the add-ins and

How to return an array from an XLL UDF

本小妞迷上赌 提交于 2019-12-12 08:59:27
问题 I'm trying to write an array constructor for Excel as a worksheet function using the C API. Goal: =array_cons(1, 2, 3) => {1, 2, 3} However, I am not initializing the XLOPER12 correctly. In Excel, my function currently returns #NUM . I am taking the argument list and packing it into a vargs array via macros then trying to return the part of the array that was supplied. #include <windows.h> #include <xlcall.h> #include <framewrk.h> #include <boost/preprocessor.hpp> #define VARG_COUNT 250

How to customize the Excel Function Wizard?

风流意气都作罢 提交于 2019-12-12 04:44:55
问题 I would like to customize the Excel Function Wizard, for instance by adding some buttons to the window and/or by firing a new event when the user press the OK Button. I know that It is possible because the Bloomberg Excel Add-in implemented it. I found no information about it on the web. I guess that I have to intercept calls to the Windows API and to play with the handle of this window to achieve this but I'm not sure. I see no way to do it via the Excel COM API or the Excel C API but I may

Receive a matrix from excel in c++ xll, modifying it and returning it

Deadly 提交于 2019-12-11 06:27:19
问题 I coded up an xll function receiving a matrix from excel, modifying it a returning it : __declspec(dllexport) LPXLOPER12 WINAPI ZZZZUpdateArray1(LPXLOPER12 arrayin) { if (arrayin->xltype == xltypeMulti | xlbitDLLFree) { double ScaleFactor = 2.0; int rows = arrayin->val.array.rows; int cols = arrayin->val.array.columns; static XLOPER12 xlArray; xlArray.val.array.lparray = reinterpret_cast<LPXLOPER12>(::new XLOPER12[rows * cols] /*::malloc(rows * cols * sizeof(XLOPER12))*/); for (int r = 0; r

C++ Excel Add-in loading error: XLL file is loaded by Excel as text file

你说的曾经没有我的故事 提交于 2019-12-10 21:54:13
问题 I'm building XLL add-ins for Excel, using C++ and XLW library. It works fine on my PC, and on many others. But in some cases, when I drag the XLL into a new Excel window, this error shows up: The file you are trying to open, 'my_addin.xll', is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now? If click yes , then Excel will open the XLL as a text file, showing

Unregister a XLL in Excel (VBA)

左心房为你撑大大i 提交于 2019-12-10 02:48:53
问题 I am just discovering the world of programming XLLs for Excel using XLW under Visual C++ 2010 and everything has been smooth so far using the template provided with the XLW package, I have a few questions: I found out that I can register an XLL by double-clicking it. What other ways are there, especially from VBA or the Excel menu? How can I unregister an XLL, both via the Excel GUI and VBA? I assume this has to be done each time I rebuild the Xll under Visual Studio. Does Excel 2010 64-bit

“addin.XLL is in a different format” issue, cannot open the xll I created by myself

吃可爱长大的小学妹 提交于 2019-12-07 18:17:00
问题 I wrote a very simple xll file in VC++ 2010, and the Excel I am using is Excel 2007. The library contains only one function: extern "C" LPXLOPER12 WINAPI tsMkErr() { static XLOPER12 x; x.xltype = xltypeErr; x.val.err = xlerrNull; return &x; } and the necessary xlAutoOpen function. I compiled and dll file, change the name to xll, and double click it to open in Excel. Everything works just as I expected. However, if I am trying to open this file on another PC, the Excel just keeps telling me