Passing Data Between Excel and the DLL
Steve Dalton · 2012
This chapter discusses the passing of data between excel and the DLL. The most flexible and important data structure used by Excel in the C API is defined as the 10-byte xloper structure in the SDK header file. The version of SDK released with Excel 2007 also describes a variation of this, the 20-byte xloper12, which accommodates the larger grids and strings introduced in this version. The xloper and xloper12 C structures, the unions they contain and the sub-structures in those unions are all described in detail in this chapter. An understanding of xlopers and, critically, how to handle the memory that can be pointed to by them is required to enable fast and direct communication between the worksheet and the C/C++ DLL, all exported commands and worksheet functions need to be registered, something that involves calling a function in the C API using xlopers, or xloper12s.