├── .gitattributes ├── .gitignore ├── ExportingCpp2xl.pdf ├── README.md ├── bsVba.xlsm └── cppFiles ├── MemoryManager.cpp ├── MemoryPool.cpp ├── MemoryPool.h ├── framework.h ├── gaussians.h ├── memorymanager.h ├── xlExport.cpp ├── xlOper.h ├── xlcall.cpp └── xlcall.h /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | *.VC.VC.opendb 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 149 | # checkin your Azure Web App publish settings, but sensitive information contained 150 | # in these scripts will be unencrypted 151 | PublishScripts/ 152 | 153 | # NuGet Packages 154 | *.nupkg 155 | # The packages folder can be ignored because of Package Restore 156 | **/packages/* 157 | # except build/, which is used as an MSBuild target. 158 | !**/packages/build/ 159 | # Uncomment if necessary however generally it will be regenerated when needed 160 | #!**/packages/repositories.config 161 | # NuGet v3's project.json files produces more ignoreable files 162 | *.nuget.props 163 | *.nuget.targets 164 | 165 | # Microsoft Azure Build Output 166 | csx/ 167 | *.build.csdef 168 | 169 | # Microsoft Azure Emulator 170 | ecf/ 171 | rcf/ 172 | 173 | # Windows Store app package directories and files 174 | AppPackages/ 175 | BundleArtifacts/ 176 | Package.StoreAssociation.xml 177 | _pkginfo.txt 178 | 179 | # Visual Studio cache files 180 | # files ending in .cache can be ignored 181 | *.[Cc]ache 182 | # but keep track of directories ending in .cache 183 | !*.[Cc]ache/ 184 | 185 | # Others 186 | ClientBin/ 187 | ~$* 188 | *~ 189 | *.dbmdl 190 | *.dbproj.schemaview 191 | *.pfx 192 | *.publishsettings 193 | node_modules/ 194 | orleans.codegen.cs 195 | 196 | # Since there are multiple workflows, uncomment next line to ignore bower_components 197 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 198 | #bower_components/ 199 | 200 | # RIA/Silverlight projects 201 | Generated_Code/ 202 | 203 | # Backup & report files from converting an old project file 204 | # to a newer Visual Studio version. Backup files are not needed, 205 | # because we have git ;-) 206 | _UpgradeReport_Files/ 207 | Backup*/ 208 | UpgradeLog*.XML 209 | UpgradeLog*.htm 210 | 211 | # SQL Server files 212 | *.mdf 213 | *.ldf 214 | 215 | # Business Intelligence projects 216 | *.rdl.data 217 | *.bim.layout 218 | *.bim_*.settings 219 | 220 | # Microsoft Fakes 221 | FakesAssemblies/ 222 | 223 | # GhostDoc plugin setting file 224 | *.GhostDoc.xml 225 | 226 | # Node.js Tools for Visual Studio 227 | .ntvs_analysis.dat 228 | 229 | # Visual Studio 6 build log 230 | *.plg 231 | 232 | # Visual Studio 6 workspace options file 233 | *.opt 234 | 235 | # Visual Studio LightSwitch build output 236 | **/*.HTMLClient/GeneratedArtifacts 237 | **/*.DesktopClient/GeneratedArtifacts 238 | **/*.DesktopClient/ModelManifest.xml 239 | **/*.Server/GeneratedArtifacts 240 | **/*.Server/ModelManifest.xml 241 | _Pvt_Extensions 242 | 243 | # Paket dependency manager 244 | .paket/paket.exe 245 | paket-files/ 246 | 247 | # FAKE - F# Make 248 | .fake/ 249 | 250 | # JetBrains Rider 251 | .idea/ 252 | *.sln.iml 253 | 254 | # ========================= 255 | # Operating System Files 256 | # ========================= 257 | 258 | # OSX 259 | # ========================= 260 | 261 | .DS_Store 262 | .AppleDouble 263 | .LSOverride 264 | 265 | # Thumbnails 266 | ._* 267 | 268 | # Files that might appear in the root of a volume 269 | .DocumentRevisions-V100 270 | .fseventsd 271 | .Spotlight-V100 272 | .TemporaryItems 273 | .Trashes 274 | .VolumeIcon.icns 275 | 276 | # Directories potentially created on remote AFP share 277 | .AppleDB 278 | .AppleDesktop 279 | Network Trash Folder 280 | Temporary Items 281 | .apdisk 282 | 283 | # Windows 284 | # ========================= 285 | 286 | # Windows image file caches 287 | Thumbs.db 288 | ehthumbs.db 289 | 290 | # Folder config file 291 | Desktop.ini 292 | 293 | # Recycle Bin used on file shares 294 | $RECYCLE.BIN/ 295 | 296 | # Windows Installer files 297 | *.cab 298 | *.msi 299 | *.msm 300 | *.msp 301 | 302 | # Windows shortcuts 303 | *.lnk 304 | *.dat 305 | *.dat 306 | /*.dat 307 | /*.dat 308 | *.bak 309 | *.*.bak 310 | *.*.*.bak 311 | *.*.*.*.bak 312 | *.*.*.*.*.bak 313 | *.txt 314 | *.db 315 | *.opendb 316 | *.*.opendb 317 | *.*.*.opendb 318 | *.*.*.*.opendb 319 | 320 | -------------------------------------------------------------------------------- /ExportingCpp2xl.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asavine/xlCppTutorial/e94c0f357c9efcaf31a8f4377b176c47f45bfc60/ExportingCpp2xl.pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Exporting C++ code to Excel : a quick and painless tutorial by Antoine Savine 2 | 3 | To export calculation C++ code to Excel is extremely practical. Excel, with all its flexibility and convenience, basically 4 | becomes the front end of your C++ application for free. 5 | Unfortunately, this is not a particularly intuitive and painless process. 6 | Books have been written on the topic, including Dalton’s excellent 600 pager: 7 | Financial Applications using Excel Development 8 | 9 | For the benefit of my students and colleagues, I wrote a quick and painless tutorial. The tutorial is in the pdf file, 10 | and the rest are the necessary files to make it work. 11 | 12 | I have had excellent feedback from people who found the tutorial particularly helpful, and decided to publish it for everybody’s benefit. 13 | Comments and suggestions are most welcome. 14 | 15 | Antoine Savine 16 | 17 | ### Note added: for 64-bit excel 18 | 19 | The tutorial works with 32-bit excel. Nowadays, excel installations often default to 64-bit. If this applies to you, the project decribed in the tutorial will compile and build an xll, but no functionality will be available when you add it into excel. The following steps enabled one user to created a project that works with 64-bit excel: 20 | 21 | 1. Download and install the excel sdk from here https://www.microsoft.com/en-us/download/details.aspx?id=35567 22 | * As part of the installation, you will choose a directory to put it in 23 | 2. Create a new totally separate directory to contain your project, and copy the following files from the sdk directory structure directly to the root of your folder 24 | * SRC/XLCALL.CPP 25 | * INCLUDE/XLCALL.H 26 | * LIB/x64/XLCALL32.LIB (note from the x64 folder if you are compiling for excel 64bit) 27 | * SAMPLES/FRAMEWORK/FRAMEWORK.H 28 | * SAMPLES/FRAMEWORK/FRAMEWORK.C 29 | * SAMPLES/FRAMEWORK/MemoryManager.cpp 30 | * SAMPLES/FRAMEWORK/MemoryManager.h 31 | * SAMPLES/FRAMEWORK/MemoryPool.cpp 32 | * SAMPLES/FRAMEWORK/MemoryPool.h 33 | 3. From this tutorial, copy the following files into the same directory 34 | * gaussians.h 35 | * xlExport.cpp 36 | * xlOper.h 37 | 4. Follow tutorial as is from now on, with the following notes 38 | * Note 1, target extension is under Configuration properties / Advanced in more recent versions of visual studio 39 | * Note 2, when you create the project, precompiled headers will have been automatically created. You don’t need to delete them, but do switch off precompiled headers as described in the tutorial (they just add an unnecessary layer of pain) 40 | * Add all the above files, including XLCALL32.LIB into your project so it will link against this 64bit version of XLCAL32.LIB 41 | 5. You can build the project in x64 mode 42 | 6. When you build the solution, you will get compile errors like Cannot open include file: 'xlcall.h'. To fix them: 43 | * Replace statements like #include (which fail to compile) with #include “xlcall.h” 44 | * There are a number of header includes like this that you will need to fix 45 | 7. You will then get compile errors about Excel12 already defined. To fix them: 46 | * In FRAMEWRK.C, delete/comment out line 76: #include "xlcall.cpp" -> //#include "xlcall.cpp" 47 | 8. In xlOper.h, change #include "framework.h" to become #include "FRAMEWRK.H" 48 | * (Alternatively, change the name of the file FRAMEWRK.H to framework.h) 49 | 50 | -------------------------------------------------------------------------------- /bsVba.xlsm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asavine/xlCppTutorial/e94c0f357c9efcaf31a8f4377b176c47f45bfc60/bsVba.xlsm -------------------------------------------------------------------------------- /cppFiles/MemoryManager.cpp: -------------------------------------------------------------------------------- 1 | ///*************************************************************************** 2 | // File: MemoryManager.cpp 3 | // 4 | // Purpose: The memory manager class is an update to the memory manager 5 | // in the previous release of the framework. This class provides 6 | // each thread with an array of bytes to use as temporary memory. 7 | // The size of the array, and the methods for dealing with the 8 | // memory explicitly, is in the class MemoryPool. 9 | // 10 | // MemoryManager handles assigning of threads to pools, and the 11 | // creation of new pools when a thread asks for memory the first 12 | // time. Using a singleton class, the manager provides an interface 13 | // to C code into the manager. The number of unique pools starts 14 | // as MEMORYPOOLS, defined in MemoryManager.h. When a new thread 15 | // needs a pool, and the current set of pools are all assigned, 16 | // the number of pools increases by a factor of two. 17 | // 18 | // Platform: Microsoft Windows 19 | // 20 | ///*************************************************************************** 21 | 22 | #include "MemoryManager.h" 23 | 24 | // 25 | // Singleton instance of the class 26 | // 27 | MemoryManager* vpmm; 28 | 29 | // 30 | // Interface for C callers to ask for memory 31 | // 32 | // See MemoryPool.h for more details 33 | // 34 | LPSTR MGetTempMemory(int cByte) 35 | { 36 | return MemoryManager::GetManager()->CPP_GetTempMemory(cByte); 37 | } 38 | 39 | // 40 | // Interface for C callers to allow their memory to be reused 41 | // 42 | // See MemoryPool.h for more details 43 | // 44 | void MFreeAllTempMemory() 45 | { 46 | MemoryManager::GetManager()->CPP_FreeAllTempMemory(); 47 | } 48 | 49 | // 50 | // Returns the singleton class, or creates one if it doesn't exit 51 | // 52 | MemoryManager* MemoryManager::GetManager() 53 | { 54 | if (!vpmm) 55 | { 56 | vpmm = new MemoryManager(); 57 | } 58 | return vpmm; 59 | } 60 | 61 | // 62 | // Default constructor 63 | // 64 | MemoryManager::MemoryManager(void) 65 | { 66 | m_impCur = 0; 67 | m_impMax = MEMORYPOOLS; 68 | m_rgmp = new MemoryPool[MEMORYPOOLS]; 69 | } 70 | 71 | // 72 | // Destructor. Because of the way memory pools get copied, 73 | // this function needs to call an additional function to clear 74 | // up the MemoryPool memory - the deconstructor on MemoryPool 75 | // does not actually delete its memory 76 | // 77 | MemoryManager::~MemoryManager(void) 78 | { 79 | MemoryPool* pmp = m_rgmp; 80 | int i; 81 | 82 | for (i = 0; i < m_impMax; i++) 83 | { 84 | if (pmp->m_rgchMemBlock) 85 | { 86 | pmp->ClearPool(); 87 | } 88 | pmp++; 89 | } 90 | delete [] m_rgmp; 91 | } 92 | 93 | // 94 | // Method that will query the correct memory pool of the calling 95 | // thread for a set number of bytes. Returns 0 if there was a 96 | // failure in getting the memory. 97 | // 98 | LPSTR MemoryManager::CPP_GetTempMemory(int cByte) 99 | { 100 | DWORD dwThreadID; 101 | MemoryPool* pmp; 102 | 103 | dwThreadID = GetCurrentThreadId(); //the id of the calling thread 104 | pmp = GetMemoryPool(dwThreadID); 105 | 106 | if (!pmp) //no more room for pools 107 | { 108 | return 0; 109 | } 110 | 111 | return pmp->GetTempMemory(cByte); 112 | } 113 | 114 | // 115 | // Method that tells the pool owned by the calling thread that 116 | // it is free to reuse all of its memory 117 | // 118 | void MemoryManager::CPP_FreeAllTempMemory() 119 | { 120 | DWORD dwThreadID; 121 | MemoryPool* pmp; 122 | 123 | dwThreadID = GetCurrentThreadId(); //the id of the calling thread 124 | pmp = GetMemoryPool(dwThreadID); 125 | 126 | if (!pmp) //no more room for pools 127 | { 128 | return; 129 | } 130 | 131 | pmp->FreeAllTempMemory(); 132 | } 133 | 134 | // 135 | // Method iterates through the memory pools in an attempt to find 136 | // the pool that matches the given thread ID. If a pool is not found, 137 | // it creates a new one 138 | // 139 | MemoryPool* MemoryManager::GetMemoryPool(DWORD dwThreadID) 140 | { 141 | int imp; //loop var 142 | MemoryPool* pmp; //current pool 143 | 144 | pmp = m_rgmp; 145 | 146 | for (imp = 0; imp < m_impCur; imp++) 147 | { 148 | if (pmp->m_dwOwner == dwThreadID) 149 | { 150 | return pmp; 151 | } 152 | 153 | pmp++; 154 | } 155 | 156 | return CreateNewPool(dwThreadID); //didn't find the owner, make a new one 157 | } 158 | 159 | // 160 | // Will assign an unused pool to a thread; should all pools be assigned, 161 | // it will grow the number of pools available. 162 | // 163 | MemoryPool* MemoryManager::CreateNewPool(DWORD dwThreadID) 164 | { 165 | if (m_impCur >= m_impMax) 166 | { 167 | GrowPools(); 168 | } 169 | m_rgmp[m_impCur++].m_dwOwner = dwThreadID; 170 | 171 | return m_rgmp+m_impCur-1; 172 | } 173 | 174 | // 175 | // Increases the number of available pools by a factor of two. All of 176 | // the old pools have their memory pointed to by the new pools. The 177 | // memory for the new pools that get replaced is first freed. The reason 178 | // ~MemoryPool() can't free its array is in this method - they would be 179 | // deleted when the old array of pools is freed at the end of the method, 180 | // despite the fact they are now being pointed to by the new pools. 181 | // 182 | void MemoryManager::GrowPools() 183 | { 184 | MemoryPool* rgmpTemp; 185 | MemoryPool* pmpDst; 186 | MemoryPool* pmpSrc; 187 | int i; 188 | 189 | pmpDst = rgmpTemp = new MemoryPool[2*m_impMax]; 190 | pmpSrc = m_rgmp; 191 | 192 | for (i = 0; i < m_impCur; i++) 193 | { 194 | delete [] pmpDst->m_rgchMemBlock; 195 | pmpDst->m_rgchMemBlock = pmpSrc->m_rgchMemBlock; 196 | pmpDst->m_dwOwner = pmpSrc->m_dwOwner; 197 | 198 | pmpDst++; 199 | pmpSrc++; 200 | } 201 | delete [] m_rgmp; 202 | m_rgmp = rgmpTemp; 203 | } 204 | -------------------------------------------------------------------------------- /cppFiles/MemoryPool.cpp: -------------------------------------------------------------------------------- 1 | ///*************************************************************************** 2 | // File: MemoryPool.cpp 3 | // 4 | // Purpose: A memory pool is an array of characters that is pre-allocated, 5 | // and used as temporary memory by the caller. The allocation 6 | // algorithm is very simple. When a thread asks for some memory, 7 | // the index into the array moves forward by that many bytes, and 8 | // a pointer is returned to the previous index before the pointer 9 | // was advanced. When a call comes to free all of the memory, the 10 | // pointer is set back to the beginning of the array. 11 | // 12 | // Each pool has MEMORYSIZE bytes of storage space available to it 13 | // 14 | // Platform: Microsoft Windows 15 | // 16 | ///*************************************************************************** 17 | 18 | #include "MemoryPool.h" 19 | 20 | // 21 | // Constructor creates the memory to be used by the pool 22 | // and starts the index at the beginning. 23 | // 24 | MemoryPool::MemoryPool(void) 25 | { 26 | m_rgchMemBlock = new char[MEMORYSIZE]; 27 | m_ichOffsetMemBlock = 0; 28 | m_dwOwner = (DWORD)-1; 29 | } 30 | 31 | // 32 | // An empty destructor - see reasoning below 33 | // 34 | MemoryPool::~MemoryPool(void) 35 | { 36 | } 37 | 38 | // 39 | // Unable to delete the memory block when we delete the pool, 40 | // as it may be still be in use due to a GrowPools() call; this 41 | // method will actually delete the pool's memory 42 | // 43 | 44 | void MemoryPool::ClearPool(void) 45 | { 46 | delete [] m_rgchMemBlock; 47 | } 48 | 49 | // 50 | // Advances the index forward by the given number of bytes. 51 | // Should there not be enough memory, or the number of bytes 52 | // is not allowed, this method will return 0. Can be called 53 | // and used exactly as malloc(). 54 | // 55 | LPSTR MemoryPool::GetTempMemory(int cBytes) 56 | { 57 | LPSTR lpMemory; 58 | 59 | if (m_ichOffsetMemBlock + cBytes > MEMORYSIZE || cBytes <= 0) 60 | { 61 | return 0; 62 | } 63 | else 64 | { 65 | lpMemory = (LPSTR) m_rgchMemBlock + m_ichOffsetMemBlock; 66 | m_ichOffsetMemBlock += cBytes; 67 | 68 | return lpMemory; 69 | } 70 | } 71 | 72 | // 73 | // Frees all the temporary memory by setting the index for 74 | // available memory back to the beginning 75 | // 76 | void MemoryPool::FreeAllTempMemory() 77 | { 78 | m_ichOffsetMemBlock = 0; 79 | } 80 | -------------------------------------------------------------------------------- /cppFiles/MemoryPool.h: -------------------------------------------------------------------------------- 1 | ///*************************************************************************** 2 | // File: MemoryPool.h 3 | // 4 | // Purpose: Class definition for the memory pool class used by the 5 | // memory manager. Each pool is a block of memory set 6 | // aside for a specific thread for use in creating temporary 7 | // XLOPER/XLOPER12's in the framework 8 | // 9 | // Platform: Microsoft Windows 10 | // 11 | ///*************************************************************************** 12 | 13 | #define WIN32_LEAN_AND_MEAN 14 | #include 15 | 16 | // 17 | // Total amount of memory to allocate for all temporary XLOPERs 18 | // 19 | 20 | #define MEMORYSIZE 4194304 21 | 22 | class MemoryPool 23 | { 24 | public: 25 | MemoryPool(void); 26 | ~MemoryPool(void); 27 | void ClearPool(void); 28 | LPSTR GetTempMemory(int cBytes); 29 | void FreeAllTempMemory(); 30 | 31 | DWORD m_dwOwner; // ID of ownning thread 32 | char* m_rgchMemBlock; // Memory for temporary XLOPERs 33 | int m_ichOffsetMemBlock; // Offset of next memory block to allocate 34 | }; 35 | -------------------------------------------------------------------------------- /cppFiles/framework.h: -------------------------------------------------------------------------------- 1 | ///*************************************************************************** 2 | // File: FRAMEWRK.H 3 | // 4 | // Purpose: Header file for Framework library 5 | // 6 | // Platform: Microsoft Windows 7 | // 8 | // Comments: 9 | // Include this file in any source files 10 | // that use the framework library. 11 | // 12 | // From the Microsoft Excel Developer's Kit, Version 12 13 | // Copyright (c) 1997 - 2007 Microsoft Corporation. All rights reserved. 14 | ///*************************************************************************** 15 | 16 | #pragma once 17 | 18 | #include 19 | 20 | #include "memorymanager.h" 21 | 22 | extern "C" LPSTR cdecl GetTempMemory(int cBytes) 23 | { 24 | return MGetTempMemory(cBytes); 25 | } 26 | 27 | extern "C" void cdecl FreeAllTempMemory(void) 28 | { 29 | MFreeAllTempMemory(); 30 | } 31 | 32 | extern "C" int cdecl Excel12f(int xlfn, LPXLOPER12 pxResult, int count, ...) 33 | { 34 | int xlret = Excel12v(xlfn, pxResult, count, (LPXLOPER12 *)(&count + 1)); 35 | FreeAllTempMemory(); 36 | return xlret; 37 | } 38 | 39 | extern "C" LPXLOPER12 TempStr12(const XCHAR* lpstr) 40 | { 41 | LPXLOPER12 lpx; 42 | XCHAR* lps; 43 | int len; 44 | 45 | len = lstrlenW(lpstr); 46 | 47 | lpx = (LPXLOPER12)GetTempMemory(sizeof(XLOPER12) + (len + 1) * 2); 48 | 49 | if (!lpx) 50 | { 51 | return 0; 52 | } 53 | 54 | lps = (XCHAR*)((CHAR*)lpx + sizeof(XLOPER12)); 55 | 56 | lps[0] = (BYTE)len; 57 | //can't wcscpy_s because of removal of null-termination 58 | wmemcpy_s(lps + 1, len + 1, lpstr, len); 59 | lpx->xltype = xltypeStr; 60 | lpx->val.str = lps; 61 | 62 | return lpx; 63 | } 64 | 65 | extern "C" LPXLOPER12 TempErr12(int err) 66 | { 67 | LPXLOPER12 lpx; 68 | 69 | lpx = (LPXLOPER12)GetTempMemory(sizeof(XLOPER12)); 70 | 71 | if (!lpx) 72 | { 73 | return 0; 74 | } 75 | 76 | lpx->xltype = xltypeErr; 77 | lpx->val.err = err; 78 | 79 | return lpx; 80 | } 81 | 82 | LPXLOPER12 TempNum12(double d) 83 | { 84 | LPXLOPER12 lpx; 85 | 86 | lpx = (LPXLOPER12)GetTempMemory(sizeof(XLOPER12)); 87 | 88 | if (!lpx) 89 | { 90 | return 0; 91 | } 92 | 93 | lpx->xltype = xltypeNum; 94 | lpx->val.num = d; 95 | 96 | return lpx; 97 | } -------------------------------------------------------------------------------- /cppFiles/gaussians.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | using namespace std; 7 | 8 | #define EPS 1.0e-08 9 | 10 | // Gaussian functions 11 | 12 | // Normal density 13 | inline double normalDens(const double x) 14 | { 15 | return x<-10.0 || 10.0 10.0) return 1.0; 25 | if (x < 0.0) return 1.0 - normalCdf(-x); 26 | 27 | static constexpr double p = 0.2316419; 28 | static constexpr double b1 = 0.319381530; 29 | static constexpr double b2 = -0.356563782; 30 | static constexpr double b3 = 1.781477937; 31 | static constexpr double b4 = -1.821255978; 32 | static constexpr double b5 = 1.330274429; 33 | 34 | const auto t = 1.0 / (1.0 + p*x); 35 | 36 | const auto pol = t*(b1 + t*(b2 + t*(b3 + t*(b4 + t*b5)))); 37 | 38 | const auto pdf = normalDens(x); 39 | 40 | return 1.0 - pdf * pol; 41 | } 42 | 43 | // Inverse CDF (for generation of Gaussians out of Uniforms) 44 | // Beasley-Springer-Moro algorithm 45 | // Moro, The full Monte, Risk, 1995 46 | // See Glasserman, Monte Carlo Methods in Financial Engineering, p 68 47 | inline double invNormalCdf(const double p) 48 | { 49 | const bool sup = p > 0.5; 50 | const double up = sup ? 1.0 - p : p; 51 | 52 | static constexpr double a0 = 2.50662823884; 53 | static constexpr double a1 = -18.61500062529; 54 | static constexpr double a2 = 41.39119773534; 55 | static constexpr double a3 = -25.44106049637; 56 | 57 | static constexpr double b0 = -8.47351093090; 58 | static constexpr double b1 = 23.08336743743; 59 | static constexpr double b2 = -21.06224101826; 60 | static constexpr double b3 = 3.13082909833; 61 | 62 | static constexpr double c0 = 0.3374754822726147; 63 | static constexpr double c1 = 0.9761690190917186; 64 | static constexpr double c2 = 0.1607979714918209; 65 | static constexpr double c3 = 0.0276438810333863; 66 | static constexpr double c4 = 0.0038405729373609; 67 | static constexpr double c5 = 0.0003951896511919; 68 | static constexpr double c6 = 0.0000321767881768; 69 | static constexpr double c7 = 0.0000002888167364; 70 | static constexpr double c8 = 0.0000003960315187; 71 | 72 | double x = up - 0.5; 73 | double r; 74 | 75 | if (fabs(x)<0.42) 76 | { 77 | r = x*x; 78 | r = x*(((a3*r + a2)*r + a1)*r + a0) / ((((b3*r + b2)*r + b1)*r + b0)*r + 1.0); 79 | return sup ? -r: r; 80 | } 81 | 82 | r = up; 83 | r = log(-log(r)); 84 | r = c0 + r*(c1 + r*(c2 + r*(c3 + r*(c4 + r*(c5 + r*(c6 + r*(c7 + r*c8))))))); 85 | 86 | return sup? r: -r; 87 | } 88 | -------------------------------------------------------------------------------- /cppFiles/memorymanager.h: -------------------------------------------------------------------------------- 1 | ///*************************************************************************** 2 | // File: MemoryManager.h 3 | // 4 | // Purpose: Class definition for the memory manager used in the framework 5 | // library. Includes exported methods for accessing the class 6 | // in C. 7 | // 8 | // Platform: Microsoft Windows 9 | // 10 | ///*************************************************************************** 11 | 12 | #ifdef __cplusplus 13 | 14 | #include "MemoryPool.h" 15 | 16 | // 17 | // Total number of memory allocation pools to manage 18 | // 19 | 20 | #define MEMORYPOOLS 4 21 | 22 | class MemoryManager 23 | { 24 | public: 25 | MemoryManager(void); 26 | ~MemoryManager(void); 27 | 28 | static MemoryManager* GetManager(); 29 | 30 | LPSTR CPP_GetTempMemory(int cByte); 31 | void CPP_FreeAllTempMemory(); 32 | 33 | private: 34 | MemoryPool* CreateNewPool(DWORD dwThreadID); 35 | MemoryPool* GetMemoryPool(DWORD dwThreadID); 36 | void GrowPools(); 37 | 38 | int m_impCur; // Current number of pools 39 | int m_impMax; // Max number of mem pools 40 | MemoryPool* m_rgmp; // Storage for the memory pools 41 | }; 42 | 43 | #endif //__cplusplus 44 | 45 | // 46 | // Defines functions for accessing class from a C projects 47 | // 48 | 49 | #ifdef __cplusplus 50 | extern "C" 51 | { 52 | #endif 53 | LPSTR MGetTempMemory(int cByte); 54 | void MFreeAllTempMemory(); 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | -------------------------------------------------------------------------------- /cppFiles/xlExport.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "xlcall.h" 4 | #include "framework.h" 5 | 6 | // Wrappers 7 | 8 | extern "C" __declspec(dllexport) 9 | double xMultiply2Numbers(double x, double y) 10 | { 11 | return x * y; 12 | } 13 | 14 | // Registers 15 | 16 | extern "C" __declspec(dllexport) int xlAutoOpen(void) 17 | { 18 | XLOPER12 xDLL; 19 | 20 | Excel12f(xlGetName, &xDLL, 0); 21 | 22 | Excel12f(xlfRegister, 0, 11, (LPXLOPER12)&xDLL, 23 | (LPXLOPER12)TempStr12(L"xMultiply2Numbers"), 24 | (LPXLOPER12)TempStr12(L"BBB"), 25 | (LPXLOPER12)TempStr12(L"xMultiply2Numbers"), 26 | (LPXLOPER12)TempStr12(L"x, y"), 27 | (LPXLOPER12)TempStr12(L"1"), 28 | (LPXLOPER12)TempStr12(L"myOwnCppFunctions"), 29 | (LPXLOPER12)TempStr12(L""), 30 | (LPXLOPER12)TempStr12(L""), 31 | (LPXLOPER12)TempStr12(L"Multiplies 2 numbers"), 32 | (LPXLOPER12)TempStr12(L"")); 33 | 34 | /* Free the XLL filename */ 35 | Excel12f(xlFree, 0, 1, (LPXLOPER12)&xDLL); 36 | 37 | return 1; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /cppFiles/xlOper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #pragma warning(disable:4996) 4 | 5 | // General interface for ranges with strings 6 | 7 | #include "xlcall.h" 8 | #include "framework.h" 9 | #include 10 | using namespace std; 11 | 12 | // Additional / alternative functions to the ones in framework.h 13 | 14 | LPXLOPER12 TempXLOPER12() 15 | { 16 | LPXLOPER12 lpx; 17 | 18 | lpx = (LPXLOPER12)GetTempMemory(sizeof(XLOPER12)); 19 | 20 | if (!lpx) 21 | { 22 | return 0; 23 | } 24 | 25 | return lpx; 26 | } 27 | 28 | LPXLOPER12 TempStr12(const string str) 29 | { 30 | LPXLOPER12 lpx = TempXLOPER12(); 31 | if (!lpx) 32 | { 33 | return 0; 34 | } 35 | 36 | lpx->xltype = xltypeStr; 37 | 38 | lpx->val.str = (wchar_t*)GetTempMemory((str.size() + 1) * sizeof(wchar_t)); 39 | if (!lpx->val.str) 40 | { 41 | return 0; 42 | } 43 | 44 | if (str.size()>0) mbstowcs(lpx->val.str + 1, str.data(), str.size()); 45 | lpx->val.str[0] = static_cast(str.size()); 46 | 47 | return lpx; 48 | } 49 | 50 | // Getters 51 | 52 | // Get argument from Excel 53 | // Register as type Q 54 | // Get as LPXLOPER12 55 | 56 | // Number of rows or 0 if invalid 57 | size_t getRows(const LPXLOPER12& oper) 58 | { 59 | if (!oper) return 0; 60 | if (oper->xltype != xltypeMulti) return 1; 61 | return oper->val.array.rows; 62 | } 63 | 64 | // Number of columns or 0 if invalid 65 | size_t getCols(const LPXLOPER12& oper) 66 | { 67 | if (!oper) return 0; 68 | if (oper->xltype != xltypeMulti) return 1; 69 | return oper->val.array.columns; 70 | } 71 | 72 | // String in position (i, j) or "" if invalid 73 | string getString(const LPXLOPER12& oper, const size_t i = 0, const size_t j = 0) 74 | { 75 | if (!oper) return ""; 76 | 77 | LPXLOPER12 strOper; 78 | 79 | if (oper->xltype == xltypeStr && i == 0 && j == 0) 80 | { 81 | strOper = oper; 82 | } 83 | else if (oper->xltype == xltypeMulti) 84 | { 85 | strOper = oper->val.array.lparray + i * getCols(oper) + j; 86 | if (strOper->xltype != xltypeStr) return ""; 87 | } 88 | else 89 | { 90 | return ""; 91 | } 92 | 93 | string str; 94 | str.resize(strOper->val.str[0]); 95 | wcstombs(&str[0], strOper->val.str + 1, strOper->val.str[0]); 96 | 97 | return str; 98 | } 99 | 100 | // Number in position (i, j) or infinity if invalid 101 | double getNum(const LPXLOPER12& oper, const size_t i = 0, const size_t j = 0) 102 | { 103 | if (!oper) return numeric_limits::infinity(); 104 | if (oper->xltype == xltypeNum && i == 0 && j == 0) 105 | { 106 | return oper->val.num; 107 | } 108 | else if (oper->xltype == xltypeMulti) 109 | { 110 | XLOPER12 nOper = oper->val.array.lparray[i * getCols(oper) + j]; 111 | if (nOper.xltype != xltypeNum) return numeric_limits::infinity(); 112 | return nOper.val.num; 113 | 114 | } 115 | else 116 | { 117 | return numeric_limits::infinity(); 118 | } 119 | } 120 | 121 | // Setter to return result to Excel 122 | // Register as type Q 123 | // Return as LPXLOPER12 124 | void resize(LPXLOPER12& oper, const size_t rows, const size_t cols) 125 | { 126 | oper->xltype = xltypeMulti; 127 | oper->val.array.rows = rows; 128 | oper->val.array.columns = cols; 129 | oper->val.array.lparray = (LPXLOPER12)GetTempMemory(rows*cols*sizeof(XLOPER12)); 130 | LPXLOPER12 nilOper = TempStr12(""); 131 | fill(oper->val.array.lparray, oper->val.array.lparray + rows*cols, *nilOper); 132 | } 133 | 134 | // Set string in position (i, j) 135 | void setString(LPXLOPER12& oper, const string& str, const size_t i = 0, const size_t j = 0) 136 | { 137 | XLOPER12& strOper = oper->val.array.lparray[i * getCols(oper) + j]; 138 | strOper = * TempStr12(str.c_str()); 139 | } 140 | 141 | // Number in position (i, j) or infinity if invalid 142 | void setNum(LPXLOPER12& oper, const double num, const size_t i = 0, const size_t j = 0) 143 | { 144 | XLOPER12& nOper = oper->val.array.lparray[i * getCols(oper) + j]; 145 | nOper.xltype = xltypeNum; 146 | nOper.val.num = num; 147 | } 148 | -------------------------------------------------------------------------------- /cppFiles/xlcall.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ** Microsoft Excel Developer's Toolkit 3 | ** Version 12.0 4 | ** 5 | ** File: INCLUDE\XLCALL.CPP 6 | ** Description: Code file for Excel 2007 callbacks 7 | ** Platform: Microsoft Windows 8 | ** 9 | ** This file defines the entry points 10 | ** which are used in the Microsoft Excel 2007 C API. 11 | ** 12 | */ 13 | 14 | #ifndef _WINDOWS_ 15 | #define WIN32_LEAN_AND_MEAN 16 | #include 17 | #endif 18 | 19 | #include "xlcall.h" 20 | 21 | /* 22 | ** Excel 12 entry points backwards compatible with Excel 11 23 | ** 24 | ** Excel12 and Excel12v ensure backwards compatibility with Excel 11 25 | ** and earlier versions. These functions will return xlretFailed when 26 | ** used to callback into Excel 11 and earlier versions 27 | */ 28 | 29 | #define cxloper12Max 255 30 | #define EXCEL12ENTRYPT "MdCallBack12" 31 | 32 | typedef int (PASCAL *EXCEL12PROC) (int xlfn, int coper, LPXLOPER12 *rgpxloper12, LPXLOPER12 xloper12Res); 33 | 34 | HMODULE hmodule; 35 | EXCEL12PROC pexcel12; 36 | 37 | __forceinline void FetchExcel12EntryPt(void) 38 | { 39 | if (pexcel12 == NULL) 40 | { 41 | hmodule = GetModuleHandle(NULL); 42 | if (hmodule != NULL) 43 | { 44 | pexcel12 = (EXCEL12PROC) GetProcAddress(hmodule, EXCEL12ENTRYPT); 45 | } 46 | } 47 | } 48 | 49 | int _cdecl Excel12(int xlfn, LPXLOPER12 operRes, int count, ...) 50 | { 51 | 52 | #ifdef _WIN64 53 | 54 | return(xlretFailed); 55 | 56 | #else 57 | 58 | LPXLOPER12 rgxloper12[cxloper12Max]; 59 | va_list ap; 60 | int ioper; 61 | int mdRet; 62 | 63 | FetchExcel12EntryPt(); 64 | if (pexcel12 == NULL) 65 | { 66 | mdRet = xlretFailed; 67 | } 68 | else 69 | { 70 | mdRet = xlretInvCount; 71 | if ((count >= 0) && (count <= cxloper12Max)) 72 | { 73 | va_start(ap, count); 74 | for (ioper = 0; ioper < count ; ioper++) 75 | { 76 | rgxloper12[ioper] = va_arg(ap, LPXLOPER12); 77 | } 78 | va_end(ap); 79 | mdRet = (pexcel12)(xlfn, count, &rgxloper12[0], operRes); 80 | } 81 | } 82 | return(mdRet); 83 | 84 | #endif 85 | } 86 | 87 | int pascal Excel12v(int xlfn, LPXLOPER12 operRes, int count, LPXLOPER12 opers[]) 88 | { 89 | #ifdef _WIN64 90 | 91 | return(xlretFailed); 92 | 93 | #else 94 | 95 | int mdRet; 96 | 97 | FetchExcel12EntryPt(); 98 | if (pexcel12 == NULL) 99 | { 100 | mdRet = xlretFailed; 101 | } 102 | else 103 | { 104 | mdRet = (pexcel12)(xlfn, count, &opers[0], operRes); 105 | } 106 | return(mdRet); 107 | 108 | #endif 109 | } 110 | -------------------------------------------------------------------------------- /cppFiles/xlcall.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Microsoft Excel Developer's Toolkit 3 | ** Version 12.0 4 | ** 5 | ** File: INCLUDE\XLCALL.H 6 | ** Description: Header file for for Excel callbacks 7 | ** Platform: Microsoft Windows 8 | ** 9 | ** DEPENDENCY: 10 | ** Include before you include this. 11 | ** 12 | ** This file defines the constants and 13 | ** data types which are used in the 14 | ** Microsoft Excel C API. 15 | ** 16 | */ 17 | 18 | #pragma once 19 | 20 | /* 21 | ** XL 12 Basic Datatypes 22 | **/ 23 | 24 | typedef INT32 BOOL; /* Boolean */ 25 | typedef WCHAR XCHAR; /* Wide Character */ 26 | typedef INT32 RW; /* XL 12 Row */ 27 | typedef INT32 COL; /* XL 12 Column */ 28 | 29 | /* 30 | ** XLREF structure 31 | ** 32 | ** Describes a single rectangular reference. 33 | */ 34 | 35 | typedef struct xlref 36 | { 37 | WORD rwFirst; 38 | WORD rwLast; 39 | BYTE colFirst; 40 | BYTE colLast; 41 | } XLREF, *LPXLREF; 42 | 43 | 44 | /* 45 | ** XLMREF structure 46 | ** 47 | ** Describes multiple rectangular references. 48 | ** This is a variable size structure, default 49 | ** size is 1 reference. 50 | */ 51 | 52 | typedef struct xlmref 53 | { 54 | WORD count; 55 | XLREF reftbl[1]; /* actually reftbl[count] */ 56 | } XLMREF, *LPXLMREF; 57 | 58 | 59 | /* 60 | ** XLREF12 structure 61 | ** 62 | ** Describes a single XL 12 rectangular reference. 63 | */ 64 | 65 | typedef struct xlref12 66 | { 67 | RW rwFirst; 68 | RW rwLast; 69 | COL colFirst; 70 | COL colLast; 71 | } XLREF12, *LPXLREF12; 72 | 73 | 74 | /* 75 | ** XLMREF12 structure 76 | ** 77 | ** Describes multiple rectangular XL 12 references. 78 | ** This is a variable size structure, default 79 | ** size is 1 reference. 80 | */ 81 | 82 | typedef struct xlmref12 83 | { 84 | WORD count; 85 | XLREF12 reftbl[1]; /* actually reftbl[count] */ 86 | } XLMREF12, *LPXLMREF12; 87 | 88 | 89 | /* 90 | ** FP structure 91 | ** 92 | ** Describes FP structure. 93 | */ 94 | 95 | typedef struct _FP 96 | { 97 | unsigned short int rows; 98 | unsigned short int columns; 99 | double array[1]; /* Actually, array[rows][columns] */ 100 | } FP; 101 | 102 | /* 103 | ** FP12 structure 104 | ** 105 | ** Describes FP structure capable of handling the big grid. 106 | */ 107 | 108 | typedef struct _FP12 109 | { 110 | INT32 rows; 111 | INT32 columns; 112 | double array[1]; /* Actually, array[rows][columns] */ 113 | } FP12; 114 | 115 | 116 | /* 117 | ** XLOPER structure 118 | ** 119 | ** Excel's fundamental data type: can hold data 120 | ** of any type. Use "R" as the argument type in the 121 | ** REGISTER function. 122 | **/ 123 | 124 | typedef struct xloper 125 | { 126 | union 127 | { 128 | double num; /* xltypeNum */ 129 | LPSTR str; /* xltypeStr */ 130 | #ifdef __cplusplus 131 | WORD xbool; /* xltypeBool */ 132 | #else 133 | WORD bool; /* xltypeBool */ 134 | #endif 135 | WORD err; /* xltypeErr */ 136 | short int w; /* xltypeInt */ 137 | struct 138 | { 139 | WORD count; /* always = 1 */ 140 | XLREF ref; 141 | } sref; /* xltypeSRef */ 142 | struct 143 | { 144 | XLMREF *lpmref; 145 | DWORD idSheet; 146 | } mref; /* xltypeRef */ 147 | struct 148 | { 149 | struct xloper *lparray; 150 | WORD rows; 151 | WORD columns; 152 | } array; /* xltypeMulti */ 153 | struct 154 | { 155 | union 156 | { 157 | short int level; /* xlflowRestart */ 158 | short int tbctrl; /* xlflowPause */ 159 | DWORD idSheet; /* xlflowGoto */ 160 | } valflow; 161 | WORD rw; /* xlflowGoto */ 162 | BYTE col; /* xlflowGoto */ 163 | BYTE xlflow; 164 | } flow; /* xltypeFlow */ 165 | struct 166 | { 167 | union 168 | { 169 | BYTE *lpbData; /* data passed to XL */ 170 | HANDLE hdata; /* data returned from XL */ 171 | } h; 172 | long cbData; 173 | } bigdata; /* xltypeBigData */ 174 | } val; 175 | WORD xltype; 176 | } XLOPER, *LPXLOPER; 177 | 178 | /* 179 | ** XLOPER12 structure 180 | ** 181 | ** Excel 12's fundamental data type: can hold data 182 | ** of any type. Use "U" as the argument type in the 183 | ** REGISTER function. 184 | **/ 185 | 186 | typedef struct xloper12 187 | { 188 | union 189 | { 190 | double num; /* xltypeNum */ 191 | XCHAR *str; /* xltypeStr */ 192 | BOOL xbool; /* xltypeBool */ 193 | int err; /* xltypeErr */ 194 | int w; 195 | struct 196 | { 197 | WORD count; /* always = 1 */ 198 | XLREF12 ref; 199 | } sref; /* xltypeSRef */ 200 | struct 201 | { 202 | XLMREF12 *lpmref; 203 | DWORD idSheet; 204 | } mref; /* xltypeRef */ 205 | struct 206 | { 207 | struct xloper12 *lparray; 208 | RW rows; 209 | COL columns; 210 | } array; /* xltypeMulti */ 211 | struct 212 | { 213 | union 214 | { 215 | int level; /* xlflowRestart */ 216 | int tbctrl; /* xlflowPause */ 217 | DWORD idSheet; /* xlflowGoto */ 218 | } valflow; 219 | RW rw; /* xlflowGoto */ 220 | COL col; /* xlflowGoto */ 221 | BYTE xlflow; 222 | } flow; /* xltypeFlow */ 223 | struct 224 | { 225 | union 226 | { 227 | BYTE *lpbData; /* data passed to XL */ 228 | HANDLE hdata; /* data returned from XL */ 229 | } h; 230 | long cbData; 231 | } bigdata; /* xltypeBigData */ 232 | } val; 233 | DWORD xltype; 234 | } XLOPER12, *LPXLOPER12; 235 | 236 | /* 237 | ** XLOPER and XLOPER12 data types 238 | ** 239 | ** Used for xltype field of XLOPER and XLOPER12 structures 240 | */ 241 | 242 | #define xltypeNum 0x0001 243 | #define xltypeStr 0x0002 244 | #define xltypeBool 0x0004 245 | #define xltypeRef 0x0008 246 | #define xltypeErr 0x0010 247 | #define xltypeFlow 0x0020 248 | #define xltypeMulti 0x0040 249 | #define xltypeMissing 0x0080 250 | #define xltypeNil 0x0100 251 | #define xltypeSRef 0x0400 252 | #define xltypeInt 0x0800 253 | 254 | #define xlbitXLFree 0x1000 255 | #define xlbitDLLFree 0x4000 256 | 257 | #define xltypeBigData (xltypeStr | xltypeInt) 258 | 259 | 260 | /* 261 | ** Error codes 262 | ** 263 | ** Used for val.err field of XLOPER and XLOPER12 structures 264 | ** when constructing error XLOPERs and XLOPER12s 265 | */ 266 | 267 | #define xlerrNull 0 268 | #define xlerrDiv0 7 269 | #define xlerrValue 15 270 | #define xlerrRef 23 271 | #define xlerrName 29 272 | #define xlerrNum 36 273 | #define xlerrNA 42 274 | 275 | 276 | /* 277 | ** Flow data types 278 | ** 279 | ** Used for val.flow.xlflow field of XLOPER and XLOPER12 structures 280 | ** when constructing flow-control XLOPERs and XLOPER12s 281 | **/ 282 | 283 | #define xlflowHalt 1 284 | #define xlflowGoto 2 285 | #define xlflowRestart 8 286 | #define xlflowPause 16 287 | #define xlflowResume 64 288 | 289 | 290 | /* 291 | ** Return codes 292 | ** 293 | ** These values can be returned from Excel4(), Excel4v(), Excel12() or Excel12v(). 294 | */ 295 | 296 | #define xlretSuccess 0 /* success */ 297 | #define xlretAbort 1 /* macro halted */ 298 | #define xlretInvXlfn 2 /* invalid function number */ 299 | #define xlretInvCount 4 /* invalid number of arguments */ 300 | #define xlretInvXloper 8 /* invalid OPER structure */ 301 | #define xlretStackOvfl 16 /* stack overflow */ 302 | #define xlretFailed 32 /* command failed */ 303 | #define xlretUncalced 64 /* uncalced cell */ 304 | #define xlretNotThreadSafe 128 /* not allowed during multi-threaded calc */ 305 | 306 | 307 | /* 308 | ** Function prototypes 309 | */ 310 | 311 | #ifdef __cplusplus 312 | extern "C" { 313 | #endif 314 | 315 | int _cdecl Excel4(int xlfn, LPXLOPER operRes, int count,... ); 316 | /* followed by count LPXLOPERs */ 317 | 318 | int pascal Excel4v(int xlfn, LPXLOPER operRes, int count, LPXLOPER opers[]); 319 | 320 | int pascal XLCallVer(void); 321 | 322 | long pascal LPenHelper(int wCode, VOID *lpv); 323 | 324 | int _cdecl Excel12(int xlfn, LPXLOPER12 operRes, int count,... ); 325 | /* followed by count LPXLOPER12s */ 326 | 327 | int pascal Excel12v(int xlfn, LPXLOPER12 operRes, int count, LPXLOPER12 opers[]); 328 | 329 | #ifdef __cplusplus 330 | } 331 | #endif 332 | 333 | 334 | /* 335 | ** Function number bits 336 | */ 337 | 338 | #define xlCommand 0x8000 339 | #define xlSpecial 0x4000 340 | #define xlIntl 0x2000 341 | #define xlPrompt 0x1000 342 | 343 | 344 | /* 345 | ** Auxiliary function numbers 346 | ** 347 | ** These functions are available only from the C API, 348 | ** not from the Excel macro language. 349 | */ 350 | 351 | #define xlFree (0 | xlSpecial) 352 | #define xlStack (1 | xlSpecial) 353 | #define xlCoerce (2 | xlSpecial) 354 | #define xlSet (3 | xlSpecial) 355 | #define xlSheetId (4 | xlSpecial) 356 | #define xlSheetNm (5 | xlSpecial) 357 | #define xlAbort (6 | xlSpecial) 358 | #define xlGetInst (7 | xlSpecial) 359 | #define xlGetHwnd (8 | xlSpecial) 360 | #define xlGetName (9 | xlSpecial) 361 | #define xlEnableXLMsgs (10 | xlSpecial) 362 | #define xlDisableXLMsgs (11 | xlSpecial) 363 | #define xlDefineBinaryName (12 | xlSpecial) 364 | #define xlGetBinaryName (13 | xlSpecial) 365 | /* GetFooInfo are valid only for calls to LPenHelper */ 366 | #define xlGetFmlaInfo (14 | xlSpecial) 367 | #define xlGetMouseInfo (15 | xlSpecial) 368 | 369 | /* edit modes */ 370 | #define xlModeReady 0 // not in edit mode 371 | #define xlModeEnter 1 // enter mode 372 | #define xlModeEdit 2 // edit mode 373 | #define xlModePoint 4 // point mode 374 | 375 | /* document(page) types */ 376 | #define dtNil 0x7f // window is not a sheet, macro, chart or basic 377 | // OR window is not the selected window at idle state 378 | #define dtSheet 0 // sheet 379 | #define dtProc 1 // XLM macro 380 | #define dtChart 2 // Chart 381 | #define dtBasic 6 // VBA 382 | 383 | /* hit test codes */ 384 | #define htNone 0x00 // none of below 385 | #define htClient 0x01 // internal for "in the client are", should never see 386 | #define htVSplit 0x02 // vertical split area with split panes 387 | #define htHSplit 0x03 // horizontal split area 388 | #define htColWidth 0x04 // column width adjuster area 389 | #define htRwHeight 0x05 // row height adjuster area 390 | #define htRwColHdr 0x06 // the intersection of row and column headers 391 | #define htObject 0x07 // the body of an object 392 | // the following are for size handles of draw objects 393 | #define htTopLeft 0x08 394 | #define htBotLeft 0x09 395 | #define htLeft 0x0A 396 | #define htTopRight 0x0B 397 | #define htBotRight 0x0C 398 | #define htRight 0x0D 399 | #define htTop 0x0E 400 | #define htBot 0x0F 401 | // end size handles 402 | #define htRwGut 0x10 // row area of outline gutter 403 | #define htColGut 0x11 // column area of outline gutter 404 | #define htTextBox 0x12 // body of a text box (where we shouw I-Beam cursor) 405 | #define htRwLevels 0x13 // row levels buttons of outline gutter 406 | #define htColLevels 0x14 // column levels buttons of outline gutter 407 | #define htDman 0x15 // the drag/drop handle of the selection 408 | #define htDmanFill 0x16 // the auto-fill handle of the selection 409 | #define htXSplit 0x17 // the intersection of the horz & vert pane splits 410 | #define htVertex 0x18 // a vertex of a polygon draw object 411 | #define htAddVtx 0x19 // htVertex in add a vertex mode 412 | #define htDelVtx 0x1A // htVertex in delete a vertex mode 413 | #define htRwHdr 0x1B // row header 414 | #define htColHdr 0x1C // column header 415 | #define htRwShow 0x1D // Like htRowHeight except means grow a hidden column 416 | #define htColShow 0x1E // column version of htRwShow 417 | #define htSizing 0x1F // Internal use only 418 | #define htSxpivot 0x20 // a drag/drop tile in a pivot table 419 | #define htTabs 0x21 // the sheet paging tabs 420 | #define htEdit 0x22 // Internal use only 421 | 422 | typedef struct _fmlainfo 423 | { 424 | int wPointMode; // current edit mode. 0 => rest of struct undefined 425 | int cch; // count of characters in formula 426 | char *lpch; // pointer to formula characters. READ ONLY!!! 427 | int ichFirst; // char offset to start of selection 428 | int ichLast; // char offset to end of selection (may be > cch) 429 | int ichCaret; // char offset to blinking caret 430 | } FMLAINFO; 431 | 432 | typedef struct _mouseinfo 433 | { 434 | /* input section */ 435 | HWND hwnd; // window to get info on 436 | POINT pt; // mouse position to get info on 437 | 438 | /* output section */ 439 | int dt; // document(page) type 440 | int ht; // hit test code 441 | int rw; // row @ mouse (-1 if #n/a) 442 | int col; // col @ mouse (-1 if #n/a) 443 | } MOUSEINFO; 444 | 445 | 446 | 447 | /* 448 | ** User defined function 449 | ** 450 | ** First argument should be a function reference. 451 | */ 452 | 453 | #define xlUDF 255 454 | 455 | 456 | /* 457 | ** Built-in Excel functions and command equivalents 458 | */ 459 | 460 | 461 | // Excel function numbers 462 | 463 | #define xlfCount 0 464 | #define xlfIsna 2 465 | #define xlfIserror 3 466 | #define xlfSum 4 467 | #define xlfAverage 5 468 | #define xlfMin 6 469 | #define xlfMax 7 470 | #define xlfRow 8 471 | #define xlfColumn 9 472 | #define xlfNa 10 473 | #define xlfNpv 11 474 | #define xlfStdev 12 475 | #define xlfDollar 13 476 | #define xlfFixed 14 477 | #define xlfSin 15 478 | #define xlfCos 16 479 | #define xlfTan 17 480 | #define xlfAtan 18 481 | #define xlfPi 19 482 | #define xlfSqrt 20 483 | #define xlfExp 21 484 | #define xlfLn 22 485 | #define xlfLog10 23 486 | #define xlfAbs 24 487 | #define xlfInt 25 488 | #define xlfSign 26 489 | #define xlfRound 27 490 | #define xlfLookup 28 491 | #define xlfIndex 29 492 | #define xlfRept 30 493 | #define xlfMid 31 494 | #define xlfLen 32 495 | #define xlfValue 33 496 | #define xlfTrue 34 497 | #define xlfFalse 35 498 | #define xlfAnd 36 499 | #define xlfOr 37 500 | #define xlfNot 38 501 | #define xlfMod 39 502 | #define xlfDcount 40 503 | #define xlfDsum 41 504 | #define xlfDaverage 42 505 | #define xlfDmin 43 506 | #define xlfDmax 44 507 | #define xlfDstdev 45 508 | #define xlfVar 46 509 | #define xlfDvar 47 510 | #define xlfText 48 511 | #define xlfLinest 49 512 | #define xlfTrend 50 513 | #define xlfLogest 51 514 | #define xlfGrowth 52 515 | #define xlfGoto 53 516 | #define xlfHalt 54 517 | #define xlfPv 56 518 | #define xlfFv 57 519 | #define xlfNper 58 520 | #define xlfPmt 59 521 | #define xlfRate 60 522 | #define xlfMirr 61 523 | #define xlfIrr 62 524 | #define xlfRand 63 525 | #define xlfMatch 64 526 | #define xlfDate 65 527 | #define xlfTime 66 528 | #define xlfDay 67 529 | #define xlfMonth 68 530 | #define xlfYear 69 531 | #define xlfWeekday 70 532 | #define xlfHour 71 533 | #define xlfMinute 72 534 | #define xlfSecond 73 535 | #define xlfNow 74 536 | #define xlfAreas 75 537 | #define xlfRows 76 538 | #define xlfColumns 77 539 | #define xlfOffset 78 540 | #define xlfAbsref 79 541 | #define xlfRelref 80 542 | #define xlfArgument 81 543 | #define xlfSearch 82 544 | #define xlfTranspose 83 545 | #define xlfError 84 546 | #define xlfStep 85 547 | #define xlfType 86 548 | #define xlfEcho 87 549 | #define xlfSetName 88 550 | #define xlfCaller 89 551 | #define xlfDeref 90 552 | #define xlfWindows 91 553 | #define xlfSeries 92 554 | #define xlfDocuments 93 555 | #define xlfActiveCell 94 556 | #define xlfSelection 95 557 | #define xlfResult 96 558 | #define xlfAtan2 97 559 | #define xlfAsin 98 560 | #define xlfAcos 99 561 | #define xlfChoose 100 562 | #define xlfHlookup 101 563 | #define xlfVlookup 102 564 | #define xlfLinks 103 565 | #define xlfInput 104 566 | #define xlfIsref 105 567 | #define xlfGetFormula 106 568 | #define xlfGetName 107 569 | #define xlfSetValue 108 570 | #define xlfLog 109 571 | #define xlfExec 110 572 | #define xlfChar 111 573 | #define xlfLower 112 574 | #define xlfUpper 113 575 | #define xlfProper 114 576 | #define xlfLeft 115 577 | #define xlfRight 116 578 | #define xlfExact 117 579 | #define xlfTrim 118 580 | #define xlfReplace 119 581 | #define xlfSubstitute 120 582 | #define xlfCode 121 583 | #define xlfNames 122 584 | #define xlfDirectory 123 585 | #define xlfFind 124 586 | #define xlfCell 125 587 | #define xlfIserr 126 588 | #define xlfIstext 127 589 | #define xlfIsnumber 128 590 | #define xlfIsblank 129 591 | #define xlfT 130 592 | #define xlfN 131 593 | #define xlfFopen 132 594 | #define xlfFclose 133 595 | #define xlfFsize 134 596 | #define xlfFreadln 135 597 | #define xlfFread 136 598 | #define xlfFwriteln 137 599 | #define xlfFwrite 138 600 | #define xlfFpos 139 601 | #define xlfDatevalue 140 602 | #define xlfTimevalue 141 603 | #define xlfSln 142 604 | #define xlfSyd 143 605 | #define xlfDdb 144 606 | #define xlfGetDef 145 607 | #define xlfReftext 146 608 | #define xlfTextref 147 609 | #define xlfIndirect 148 610 | #define xlfRegister 149 611 | #define xlfCall 150 612 | #define xlfAddBar 151 613 | #define xlfAddMenu 152 614 | #define xlfAddCommand 153 615 | #define xlfEnableCommand 154 616 | #define xlfCheckCommand 155 617 | #define xlfRenameCommand 156 618 | #define xlfShowBar 157 619 | #define xlfDeleteMenu 158 620 | #define xlfDeleteCommand 159 621 | #define xlfGetChartItem 160 622 | #define xlfDialogBox 161 623 | #define xlfClean 162 624 | #define xlfMdeterm 163 625 | #define xlfMinverse 164 626 | #define xlfMmult 165 627 | #define xlfFiles 166 628 | #define xlfIpmt 167 629 | #define xlfPpmt 168 630 | #define xlfCounta 169 631 | #define xlfCancelKey 170 632 | #define xlfInitiate 175 633 | #define xlfRequest 176 634 | #define xlfPoke 177 635 | #define xlfExecute 178 636 | #define xlfTerminate 179 637 | #define xlfRestart 180 638 | #define xlfHelp 181 639 | #define xlfGetBar 182 640 | #define xlfProduct 183 641 | #define xlfFact 184 642 | #define xlfGetCell 185 643 | #define xlfGetWorkspace 186 644 | #define xlfGetWindow 187 645 | #define xlfGetDocument 188 646 | #define xlfDproduct 189 647 | #define xlfIsnontext 190 648 | #define xlfGetNote 191 649 | #define xlfNote 192 650 | #define xlfStdevp 193 651 | #define xlfVarp 194 652 | #define xlfDstdevp 195 653 | #define xlfDvarp 196 654 | #define xlfTrunc 197 655 | #define xlfIslogical 198 656 | #define xlfDcounta 199 657 | #define xlfDeleteBar 200 658 | #define xlfUnregister 201 659 | #define xlfUsdollar 204 660 | #define xlfFindb 205 661 | #define xlfSearchb 206 662 | #define xlfReplaceb 207 663 | #define xlfLeftb 208 664 | #define xlfRightb 209 665 | #define xlfMidb 210 666 | #define xlfLenb 211 667 | #define xlfRoundup 212 668 | #define xlfRounddown 213 669 | #define xlfAsc 214 670 | #define xlfDbcs 215 671 | #define xlfRank 216 672 | #define xlfAddress 219 673 | #define xlfDays360 220 674 | #define xlfToday 221 675 | #define xlfVdb 222 676 | #define xlfMedian 227 677 | #define xlfSumproduct 228 678 | #define xlfSinh 229 679 | #define xlfCosh 230 680 | #define xlfTanh 231 681 | #define xlfAsinh 232 682 | #define xlfAcosh 233 683 | #define xlfAtanh 234 684 | #define xlfDget 235 685 | #define xlfCreateObject 236 686 | #define xlfVolatile 237 687 | #define xlfLastError 238 688 | #define xlfCustomUndo 239 689 | #define xlfCustomRepeat 240 690 | #define xlfFormulaConvert 241 691 | #define xlfGetLinkInfo 242 692 | #define xlfTextBox 243 693 | #define xlfInfo 244 694 | #define xlfGroup 245 695 | #define xlfGetObject 246 696 | #define xlfDb 247 697 | #define xlfPause 248 698 | #define xlfResume 251 699 | #define xlfFrequency 252 700 | #define xlfAddToolbar 253 701 | #define xlfDeleteToolbar 254 702 | #define xlfResetToolbar 256 703 | #define xlfEvaluate 257 704 | #define xlfGetToolbar 258 705 | #define xlfGetTool 259 706 | #define xlfSpellingCheck 260 707 | #define xlfErrorType 261 708 | #define xlfAppTitle 262 709 | #define xlfWindowTitle 263 710 | #define xlfSaveToolbar 264 711 | #define xlfEnableTool 265 712 | #define xlfPressTool 266 713 | #define xlfRegisterId 267 714 | #define xlfGetWorkbook 268 715 | #define xlfAvedev 269 716 | #define xlfBetadist 270 717 | #define xlfGammaln 271 718 | #define xlfBetainv 272 719 | #define xlfBinomdist 273 720 | #define xlfChidist 274 721 | #define xlfChiinv 275 722 | #define xlfCombin 276 723 | #define xlfConfidence 277 724 | #define xlfCritbinom 278 725 | #define xlfEven 279 726 | #define xlfExpondist 280 727 | #define xlfFdist 281 728 | #define xlfFinv 282 729 | #define xlfFisher 283 730 | #define xlfFisherinv 284 731 | #define xlfFloor 285 732 | #define xlfGammadist 286 733 | #define xlfGammainv 287 734 | #define xlfCeiling 288 735 | #define xlfHypgeomdist 289 736 | #define xlfLognormdist 290 737 | #define xlfLoginv 291 738 | #define xlfNegbinomdist 292 739 | #define xlfNormdist 293 740 | #define xlfNormsdist 294 741 | #define xlfNorminv 295 742 | #define xlfNormsinv 296 743 | #define xlfStandardize 297 744 | #define xlfOdd 298 745 | #define xlfPermut 299 746 | #define xlfPoisson 300 747 | #define xlfTdist 301 748 | #define xlfWeibull 302 749 | #define xlfSumxmy2 303 750 | #define xlfSumx2my2 304 751 | #define xlfSumx2py2 305 752 | #define xlfChitest 306 753 | #define xlfCorrel 307 754 | #define xlfCovar 308 755 | #define xlfForecast 309 756 | #define xlfFtest 310 757 | #define xlfIntercept 311 758 | #define xlfPearson 312 759 | #define xlfRsq 313 760 | #define xlfSteyx 314 761 | #define xlfSlope 315 762 | #define xlfTtest 316 763 | #define xlfProb 317 764 | #define xlfDevsq 318 765 | #define xlfGeomean 319 766 | #define xlfHarmean 320 767 | #define xlfSumsq 321 768 | #define xlfKurt 322 769 | #define xlfSkew 323 770 | #define xlfZtest 324 771 | #define xlfLarge 325 772 | #define xlfSmall 326 773 | #define xlfQuartile 327 774 | #define xlfPercentile 328 775 | #define xlfPercentrank 329 776 | #define xlfMode 330 777 | #define xlfTrimmean 331 778 | #define xlfTinv 332 779 | #define xlfMovieCommand 334 780 | #define xlfGetMovie 335 781 | #define xlfConcatenate 336 782 | #define xlfPower 337 783 | #define xlfPivotAddData 338 784 | #define xlfGetPivotTable 339 785 | #define xlfGetPivotField 340 786 | #define xlfGetPivotItem 341 787 | #define xlfRadians 342 788 | #define xlfDegrees 343 789 | #define xlfSubtotal 344 790 | #define xlfSumif 345 791 | #define xlfCountif 346 792 | #define xlfCountblank 347 793 | #define xlfScenarioGet 348 794 | #define xlfOptionsListsGet 349 795 | #define xlfIspmt 350 796 | #define xlfDatedif 351 797 | #define xlfDatestring 352 798 | #define xlfNumberstring 353 799 | #define xlfRoman 354 800 | #define xlfOpenDialog 355 801 | #define xlfSaveDialog 356 802 | #define xlfViewGet 357 803 | #define xlfGetpivotdata 358 804 | #define xlfHyperlink 359 805 | #define xlfPhonetic 360 806 | #define xlfAveragea 361 807 | #define xlfMaxa 362 808 | #define xlfMina 363 809 | #define xlfStdevpa 364 810 | #define xlfVarpa 365 811 | #define xlfStdeva 366 812 | #define xlfVara 367 813 | #define xlfBahttext 368 814 | #define xlfThaidayofweek 369 815 | #define xlfThaidigit 370 816 | #define xlfThaimonthofyear 371 817 | #define xlfThainumsound 372 818 | #define xlfThainumstring 373 819 | #define xlfThaistringlength 374 820 | #define xlfIsthaidigit 375 821 | #define xlfRoundbahtdown 376 822 | #define xlfRoundbahtup 377 823 | #define xlfThaiyear 378 824 | #define xlfRtd 379 825 | #define xlfCubevalue 380 826 | #define xlfCubemember 381 827 | #define xlfCubememberproperty 382 828 | #define xlfCuberankedmember 383 829 | #define xlfHex2bin 384 830 | #define xlfHex2dec 385 831 | #define xlfHex2oct 386 832 | #define xlfDec2bin 387 833 | #define xlfDec2hex 388 834 | #define xlfDec2oct 389 835 | #define xlfOct2bin 390 836 | #define xlfOct2hex 391 837 | #define xlfOct2dec 392 838 | #define xlfBin2dec 393 839 | #define xlfBin2oct 394 840 | #define xlfBin2hex 395 841 | #define xlfImsub 396 842 | #define xlfImdiv 397 843 | #define xlfImpower 398 844 | #define xlfImabs 399 845 | #define xlfImsqrt 400 846 | #define xlfImln 401 847 | #define xlfImlog2 402 848 | #define xlfImlog10 403 849 | #define xlfImsin 404 850 | #define xlfImcos 405 851 | #define xlfImexp 406 852 | #define xlfImargument 407 853 | #define xlfImconjugate 408 854 | #define xlfImaginary 409 855 | #define xlfImreal 410 856 | #define xlfComplex 411 857 | #define xlfImsum 412 858 | #define xlfImproduct 413 859 | #define xlfSeriessum 414 860 | #define xlfFactdouble 415 861 | #define xlfSqrtpi 416 862 | #define xlfQuotient 417 863 | #define xlfDelta 418 864 | #define xlfGestep 419 865 | #define xlfIseven 420 866 | #define xlfIsodd 421 867 | #define xlfMround 422 868 | #define xlfErf 423 869 | #define xlfErfc 424 870 | #define xlfBesselj 425 871 | #define xlfBesselk 426 872 | #define xlfBessely 427 873 | #define xlfBesseli 428 874 | #define xlfXirr 429 875 | #define xlfXnpv 430 876 | #define xlfPricemat 431 877 | #define xlfYieldmat 432 878 | #define xlfIntrate 433 879 | #define xlfReceived 434 880 | #define xlfDisc 435 881 | #define xlfPricedisc 436 882 | #define xlfYielddisc 437 883 | #define xlfTbilleq 438 884 | #define xlfTbillprice 439 885 | #define xlfTbillyield 440 886 | #define xlfPrice 441 887 | #define xlfYield 442 888 | #define xlfDollarde 443 889 | #define xlfDollarfr 444 890 | #define xlfNominal 445 891 | #define xlfEffect 446 892 | #define xlfCumprinc 447 893 | #define xlfCumipmt 448 894 | #define xlfEdate 449 895 | #define xlfEomonth 450 896 | #define xlfYearfrac 451 897 | #define xlfCoupdaybs 452 898 | #define xlfCoupdays 453 899 | #define xlfCoupdaysnc 454 900 | #define xlfCoupncd 455 901 | #define xlfCoupnum 456 902 | #define xlfCouppcd 457 903 | #define xlfDuration 458 904 | #define xlfMduration 459 905 | #define xlfOddlprice 460 906 | #define xlfOddlyield 461 907 | #define xlfOddfprice 462 908 | #define xlfOddfyield 463 909 | #define xlfRandbetween 464 910 | #define xlfWeeknum 465 911 | #define xlfAmordegrc 466 912 | #define xlfAmorlinc 467 913 | #define xlfConvert 468 914 | #define xlfAccrint 469 915 | #define xlfAccrintm 470 916 | #define xlfWorkday 471 917 | #define xlfNetworkdays 472 918 | #define xlfGcd 473 919 | #define xlfMultinomial 474 920 | #define xlfLcm 475 921 | #define xlfFvschedule 476 922 | #define xlfCubekpimember 477 923 | #define xlfCubeset 478 924 | #define xlfCubesetcount 479 925 | #define xlfIferror 480 926 | #define xlfCountifs 481 927 | #define xlfSumifs 482 928 | #define xlfAverageif 483 929 | #define xlfAverageifs 484 930 | 931 | /* Excel command numbers */ 932 | #define xlcBeep (0 | xlCommand) 933 | #define xlcOpen (1 | xlCommand) 934 | #define xlcOpenLinks (2 | xlCommand) 935 | #define xlcCloseAll (3 | xlCommand) 936 | #define xlcSave (4 | xlCommand) 937 | #define xlcSaveAs (5 | xlCommand) 938 | #define xlcFileDelete (6 | xlCommand) 939 | #define xlcPageSetup (7 | xlCommand) 940 | #define xlcPrint (8 | xlCommand) 941 | #define xlcPrinterSetup (9 | xlCommand) 942 | #define xlcQuit (10 | xlCommand) 943 | #define xlcNewWindow (11 | xlCommand) 944 | #define xlcArrangeAll (12 | xlCommand) 945 | #define xlcWindowSize (13 | xlCommand) 946 | #define xlcWindowMove (14 | xlCommand) 947 | #define xlcFull (15 | xlCommand) 948 | #define xlcClose (16 | xlCommand) 949 | #define xlcRun (17 | xlCommand) 950 | #define xlcSetPrintArea (22 | xlCommand) 951 | #define xlcSetPrintTitles (23 | xlCommand) 952 | #define xlcSetPageBreak (24 | xlCommand) 953 | #define xlcRemovePageBreak (25 | xlCommand) 954 | #define xlcFont (26 | xlCommand) 955 | #define xlcDisplay (27 | xlCommand) 956 | #define xlcProtectDocument (28 | xlCommand) 957 | #define xlcPrecision (29 | xlCommand) 958 | #define xlcA1R1c1 (30 | xlCommand) 959 | #define xlcCalculateNow (31 | xlCommand) 960 | #define xlcCalculation (32 | xlCommand) 961 | #define xlcDataFind (34 | xlCommand) 962 | #define xlcExtract (35 | xlCommand) 963 | #define xlcDataDelete (36 | xlCommand) 964 | #define xlcSetDatabase (37 | xlCommand) 965 | #define xlcSetCriteria (38 | xlCommand) 966 | #define xlcSort (39 | xlCommand) 967 | #define xlcDataSeries (40 | xlCommand) 968 | #define xlcTable (41 | xlCommand) 969 | #define xlcFormatNumber (42 | xlCommand) 970 | #define xlcAlignment (43 | xlCommand) 971 | #define xlcStyle (44 | xlCommand) 972 | #define xlcBorder (45 | xlCommand) 973 | #define xlcCellProtection (46 | xlCommand) 974 | #define xlcColumnWidth (47 | xlCommand) 975 | #define xlcUndo (48 | xlCommand) 976 | #define xlcCut (49 | xlCommand) 977 | #define xlcCopy (50 | xlCommand) 978 | #define xlcPaste (51 | xlCommand) 979 | #define xlcClear (52 | xlCommand) 980 | #define xlcPasteSpecial (53 | xlCommand) 981 | #define xlcEditDelete (54 | xlCommand) 982 | #define xlcInsert (55 | xlCommand) 983 | #define xlcFillRight (56 | xlCommand) 984 | #define xlcFillDown (57 | xlCommand) 985 | #define xlcDefineName (61 | xlCommand) 986 | #define xlcCreateNames (62 | xlCommand) 987 | #define xlcFormulaGoto (63 | xlCommand) 988 | #define xlcFormulaFind (64 | xlCommand) 989 | #define xlcSelectLastCell (65 | xlCommand) 990 | #define xlcShowActiveCell (66 | xlCommand) 991 | #define xlcGalleryArea (67 | xlCommand) 992 | #define xlcGalleryBar (68 | xlCommand) 993 | #define xlcGalleryColumn (69 | xlCommand) 994 | #define xlcGalleryLine (70 | xlCommand) 995 | #define xlcGalleryPie (71 | xlCommand) 996 | #define xlcGalleryScatter (72 | xlCommand) 997 | #define xlcCombination (73 | xlCommand) 998 | #define xlcPreferred (74 | xlCommand) 999 | #define xlcAddOverlay (75 | xlCommand) 1000 | #define xlcGridlines (76 | xlCommand) 1001 | #define xlcSetPreferred (77 | xlCommand) 1002 | #define xlcAxes (78 | xlCommand) 1003 | #define xlcLegend (79 | xlCommand) 1004 | #define xlcAttachText (80 | xlCommand) 1005 | #define xlcAddArrow (81 | xlCommand) 1006 | #define xlcSelectChart (82 | xlCommand) 1007 | #define xlcSelectPlotArea (83 | xlCommand) 1008 | #define xlcPatterns (84 | xlCommand) 1009 | #define xlcMainChart (85 | xlCommand) 1010 | #define xlcOverlay (86 | xlCommand) 1011 | #define xlcScale (87 | xlCommand) 1012 | #define xlcFormatLegend (88 | xlCommand) 1013 | #define xlcFormatText (89 | xlCommand) 1014 | #define xlcEditRepeat (90 | xlCommand) 1015 | #define xlcParse (91 | xlCommand) 1016 | #define xlcJustify (92 | xlCommand) 1017 | #define xlcHide (93 | xlCommand) 1018 | #define xlcUnhide (94 | xlCommand) 1019 | #define xlcWorkspace (95 | xlCommand) 1020 | #define xlcFormula (96 | xlCommand) 1021 | #define xlcFormulaFill (97 | xlCommand) 1022 | #define xlcFormulaArray (98 | xlCommand) 1023 | #define xlcDataFindNext (99 | xlCommand) 1024 | #define xlcDataFindPrev (100 | xlCommand) 1025 | #define xlcFormulaFindNext (101 | xlCommand) 1026 | #define xlcFormulaFindPrev (102 | xlCommand) 1027 | #define xlcActivate (103 | xlCommand) 1028 | #define xlcActivateNext (104 | xlCommand) 1029 | #define xlcActivatePrev (105 | xlCommand) 1030 | #define xlcUnlockedNext (106 | xlCommand) 1031 | #define xlcUnlockedPrev (107 | xlCommand) 1032 | #define xlcCopyPicture (108 | xlCommand) 1033 | #define xlcSelect (109 | xlCommand) 1034 | #define xlcDeleteName (110 | xlCommand) 1035 | #define xlcDeleteFormat (111 | xlCommand) 1036 | #define xlcVline (112 | xlCommand) 1037 | #define xlcHline (113 | xlCommand) 1038 | #define xlcVpage (114 | xlCommand) 1039 | #define xlcHpage (115 | xlCommand) 1040 | #define xlcVscroll (116 | xlCommand) 1041 | #define xlcHscroll (117 | xlCommand) 1042 | #define xlcAlert (118 | xlCommand) 1043 | #define xlcNew (119 | xlCommand) 1044 | #define xlcCancelCopy (120 | xlCommand) 1045 | #define xlcShowClipboard (121 | xlCommand) 1046 | #define xlcMessage (122 | xlCommand) 1047 | #define xlcPasteLink (124 | xlCommand) 1048 | #define xlcAppActivate (125 | xlCommand) 1049 | #define xlcDeleteArrow (126 | xlCommand) 1050 | #define xlcRowHeight (127 | xlCommand) 1051 | #define xlcFormatMove (128 | xlCommand) 1052 | #define xlcFormatSize (129 | xlCommand) 1053 | #define xlcFormulaReplace (130 | xlCommand) 1054 | #define xlcSendKeys (131 | xlCommand) 1055 | #define xlcSelectSpecial (132 | xlCommand) 1056 | #define xlcApplyNames (133 | xlCommand) 1057 | #define xlcReplaceFont (134 | xlCommand) 1058 | #define xlcFreezePanes (135 | xlCommand) 1059 | #define xlcShowInfo (136 | xlCommand) 1060 | #define xlcSplit (137 | xlCommand) 1061 | #define xlcOnWindow (138 | xlCommand) 1062 | #define xlcOnData (139 | xlCommand) 1063 | #define xlcDisableInput (140 | xlCommand) 1064 | #define xlcEcho (141 | xlCommand) 1065 | #define xlcOutline (142 | xlCommand) 1066 | #define xlcListNames (143 | xlCommand) 1067 | #define xlcFileClose (144 | xlCommand) 1068 | #define xlcSaveWorkbook (145 | xlCommand) 1069 | #define xlcDataForm (146 | xlCommand) 1070 | #define xlcCopyChart (147 | xlCommand) 1071 | #define xlcOnTime (148 | xlCommand) 1072 | #define xlcWait (149 | xlCommand) 1073 | #define xlcFormatFont (150 | xlCommand) 1074 | #define xlcFillUp (151 | xlCommand) 1075 | #define xlcFillLeft (152 | xlCommand) 1076 | #define xlcDeleteOverlay (153 | xlCommand) 1077 | #define xlcNote (154 | xlCommand) 1078 | #define xlcShortMenus (155 | xlCommand) 1079 | #define xlcSetUpdateStatus (159 | xlCommand) 1080 | #define xlcColorPalette (161 | xlCommand) 1081 | #define xlcDeleteStyle (162 | xlCommand) 1082 | #define xlcWindowRestore (163 | xlCommand) 1083 | #define xlcWindowMaximize (164 | xlCommand) 1084 | #define xlcError (165 | xlCommand) 1085 | #define xlcChangeLink (166 | xlCommand) 1086 | #define xlcCalculateDocument (167 | xlCommand) 1087 | #define xlcOnKey (168 | xlCommand) 1088 | #define xlcAppRestore (169 | xlCommand) 1089 | #define xlcAppMove (170 | xlCommand) 1090 | #define xlcAppSize (171 | xlCommand) 1091 | #define xlcAppMinimize (172 | xlCommand) 1092 | #define xlcAppMaximize (173 | xlCommand) 1093 | #define xlcBringToFront (174 | xlCommand) 1094 | #define xlcSendToBack (175 | xlCommand) 1095 | #define xlcMainChartType (185 | xlCommand) 1096 | #define xlcOverlayChartType (186 | xlCommand) 1097 | #define xlcSelectEnd (187 | xlCommand) 1098 | #define xlcOpenMail (188 | xlCommand) 1099 | #define xlcSendMail (189 | xlCommand) 1100 | #define xlcStandardFont (190 | xlCommand) 1101 | #define xlcConsolidate (191 | xlCommand) 1102 | #define xlcSortSpecial (192 | xlCommand) 1103 | #define xlcGallery3dArea (193 | xlCommand) 1104 | #define xlcGallery3dColumn (194 | xlCommand) 1105 | #define xlcGallery3dLine (195 | xlCommand) 1106 | #define xlcGallery3dPie (196 | xlCommand) 1107 | #define xlcView3d (197 | xlCommand) 1108 | #define xlcGoalSeek (198 | xlCommand) 1109 | #define xlcWorkgroup (199 | xlCommand) 1110 | #define xlcFillGroup (200 | xlCommand) 1111 | #define xlcUpdateLink (201 | xlCommand) 1112 | #define xlcPromote (202 | xlCommand) 1113 | #define xlcDemote (203 | xlCommand) 1114 | #define xlcShowDetail (204 | xlCommand) 1115 | #define xlcUngroup (206 | xlCommand) 1116 | #define xlcObjectProperties (207 | xlCommand) 1117 | #define xlcSaveNewObject (208 | xlCommand) 1118 | #define xlcShare (209 | xlCommand) 1119 | #define xlcShareName (210 | xlCommand) 1120 | #define xlcDuplicate (211 | xlCommand) 1121 | #define xlcApplyStyle (212 | xlCommand) 1122 | #define xlcAssignToObject (213 | xlCommand) 1123 | #define xlcObjectProtection (214 | xlCommand) 1124 | #define xlcHideObject (215 | xlCommand) 1125 | #define xlcSetExtract (216 | xlCommand) 1126 | #define xlcCreatePublisher (217 | xlCommand) 1127 | #define xlcSubscribeTo (218 | xlCommand) 1128 | #define xlcAttributes (219 | xlCommand) 1129 | #define xlcShowToolbar (220 | xlCommand) 1130 | #define xlcPrintPreview (222 | xlCommand) 1131 | #define xlcEditColor (223 | xlCommand) 1132 | #define xlcShowLevels (224 | xlCommand) 1133 | #define xlcFormatMain (225 | xlCommand) 1134 | #define xlcFormatOverlay (226 | xlCommand) 1135 | #define xlcOnRecalc (227 | xlCommand) 1136 | #define xlcEditSeries (228 | xlCommand) 1137 | #define xlcDefineStyle (229 | xlCommand) 1138 | #define xlcLinePrint (240 | xlCommand) 1139 | #define xlcEnterData (243 | xlCommand) 1140 | #define xlcGalleryRadar (249 | xlCommand) 1141 | #define xlcMergeStyles (250 | xlCommand) 1142 | #define xlcEditionOptions (251 | xlCommand) 1143 | #define xlcPastePicture (252 | xlCommand) 1144 | #define xlcPastePictureLink (253 | xlCommand) 1145 | #define xlcSpelling (254 | xlCommand) 1146 | #define xlcZoom (256 | xlCommand) 1147 | #define xlcResume (258 | xlCommand) 1148 | #define xlcInsertObject (259 | xlCommand) 1149 | #define xlcWindowMinimize (260 | xlCommand) 1150 | #define xlcSize (261 | xlCommand) 1151 | #define xlcMove (262 | xlCommand) 1152 | #define xlcSoundNote (265 | xlCommand) 1153 | #define xlcSoundPlay (266 | xlCommand) 1154 | #define xlcFormatShape (267 | xlCommand) 1155 | #define xlcExtendPolygon (268 | xlCommand) 1156 | #define xlcFormatAuto (269 | xlCommand) 1157 | #define xlcGallery3dBar (272 | xlCommand) 1158 | #define xlcGallery3dSurface (273 | xlCommand) 1159 | #define xlcFillAuto (274 | xlCommand) 1160 | #define xlcCustomizeToolbar (276 | xlCommand) 1161 | #define xlcAddTool (277 | xlCommand) 1162 | #define xlcEditObject (278 | xlCommand) 1163 | #define xlcOnDoubleclick (279 | xlCommand) 1164 | #define xlcOnEntry (280 | xlCommand) 1165 | #define xlcWorkbookAdd (281 | xlCommand) 1166 | #define xlcWorkbookMove (282 | xlCommand) 1167 | #define xlcWorkbookCopy (283 | xlCommand) 1168 | #define xlcWorkbookOptions (284 | xlCommand) 1169 | #define xlcSaveWorkspace (285 | xlCommand) 1170 | #define xlcChartWizard (288 | xlCommand) 1171 | #define xlcDeleteTool (289 | xlCommand) 1172 | #define xlcMoveTool (290 | xlCommand) 1173 | #define xlcWorkbookSelect (291 | xlCommand) 1174 | #define xlcWorkbookActivate (292 | xlCommand) 1175 | #define xlcAssignToTool (293 | xlCommand) 1176 | #define xlcCopyTool (295 | xlCommand) 1177 | #define xlcResetTool (296 | xlCommand) 1178 | #define xlcConstrainNumeric (297 | xlCommand) 1179 | #define xlcPasteTool (298 | xlCommand) 1180 | #define xlcPlacement (300 | xlCommand) 1181 | #define xlcFillWorkgroup (301 | xlCommand) 1182 | #define xlcWorkbookNew (302 | xlCommand) 1183 | #define xlcScenarioCells (305 | xlCommand) 1184 | #define xlcScenarioDelete (306 | xlCommand) 1185 | #define xlcScenarioAdd (307 | xlCommand) 1186 | #define xlcScenarioEdit (308 | xlCommand) 1187 | #define xlcScenarioShow (309 | xlCommand) 1188 | #define xlcScenarioShowNext (310 | xlCommand) 1189 | #define xlcScenarioSummary (311 | xlCommand) 1190 | #define xlcPivotTableWizard (312 | xlCommand) 1191 | #define xlcPivotFieldProperties (313 | xlCommand) 1192 | #define xlcPivotField (314 | xlCommand) 1193 | #define xlcPivotItem (315 | xlCommand) 1194 | #define xlcPivotAddFields (316 | xlCommand) 1195 | #define xlcOptionsCalculation (318 | xlCommand) 1196 | #define xlcOptionsEdit (319 | xlCommand) 1197 | #define xlcOptionsView (320 | xlCommand) 1198 | #define xlcAddinManager (321 | xlCommand) 1199 | #define xlcMenuEditor (322 | xlCommand) 1200 | #define xlcAttachToolbars (323 | xlCommand) 1201 | #define xlcVbaactivate (324 | xlCommand) 1202 | #define xlcOptionsChart (325 | xlCommand) 1203 | #define xlcVbaInsertFile (328 | xlCommand) 1204 | #define xlcVbaProcedureDefinition (330 | xlCommand) 1205 | #define xlcRoutingSlip (336 | xlCommand) 1206 | #define xlcRouteDocument (338 | xlCommand) 1207 | #define xlcMailLogon (339 | xlCommand) 1208 | #define xlcInsertPicture (342 | xlCommand) 1209 | #define xlcEditTool (343 | xlCommand) 1210 | #define xlcGalleryDoughnut (344 | xlCommand) 1211 | #define xlcChartTrend (350 | xlCommand) 1212 | #define xlcPivotItemProperties (352 | xlCommand) 1213 | #define xlcWorkbookInsert (354 | xlCommand) 1214 | #define xlcOptionsTransition (355 | xlCommand) 1215 | #define xlcOptionsGeneral (356 | xlCommand) 1216 | #define xlcFilterAdvanced (370 | xlCommand) 1217 | #define xlcMailAddMailer (373 | xlCommand) 1218 | #define xlcMailDeleteMailer (374 | xlCommand) 1219 | #define xlcMailReply (375 | xlCommand) 1220 | #define xlcMailReplyAll (376 | xlCommand) 1221 | #define xlcMailForward (377 | xlCommand) 1222 | #define xlcMailNextLetter (378 | xlCommand) 1223 | #define xlcDataLabel (379 | xlCommand) 1224 | #define xlcInsertTitle (380 | xlCommand) 1225 | #define xlcFontProperties (381 | xlCommand) 1226 | #define xlcMacroOptions (382 | xlCommand) 1227 | #define xlcWorkbookHide (383 | xlCommand) 1228 | #define xlcWorkbookUnhide (384 | xlCommand) 1229 | #define xlcWorkbookDelete (385 | xlCommand) 1230 | #define xlcWorkbookName (386 | xlCommand) 1231 | #define xlcGalleryCustom (388 | xlCommand) 1232 | #define xlcAddChartAutoformat (390 | xlCommand) 1233 | #define xlcDeleteChartAutoformat (391 | xlCommand) 1234 | #define xlcChartAddData (392 | xlCommand) 1235 | #define xlcAutoOutline (393 | xlCommand) 1236 | #define xlcTabOrder (394 | xlCommand) 1237 | #define xlcShowDialog (395 | xlCommand) 1238 | #define xlcSelectAll (396 | xlCommand) 1239 | #define xlcUngroupSheets (397 | xlCommand) 1240 | #define xlcSubtotalCreate (398 | xlCommand) 1241 | #define xlcSubtotalRemove (399 | xlCommand) 1242 | #define xlcRenameObject (400 | xlCommand) 1243 | #define xlcWorkbookScroll (412 | xlCommand) 1244 | #define xlcWorkbookNext (413 | xlCommand) 1245 | #define xlcWorkbookPrev (414 | xlCommand) 1246 | #define xlcWorkbookTabSplit (415 | xlCommand) 1247 | #define xlcFullScreen (416 | xlCommand) 1248 | #define xlcWorkbookProtect (417 | xlCommand) 1249 | #define xlcScrollbarProperties (420 | xlCommand) 1250 | #define xlcPivotShowPages (421 | xlCommand) 1251 | #define xlcTextToColumns (422 | xlCommand) 1252 | #define xlcFormatCharttype (423 | xlCommand) 1253 | #define xlcLinkFormat (424 | xlCommand) 1254 | #define xlcTracerDisplay (425 | xlCommand) 1255 | #define xlcTracerNavigate (430 | xlCommand) 1256 | #define xlcTracerClear (431 | xlCommand) 1257 | #define xlcTracerError (432 | xlCommand) 1258 | #define xlcPivotFieldGroup (433 | xlCommand) 1259 | #define xlcPivotFieldUngroup (434 | xlCommand) 1260 | #define xlcCheckboxProperties (435 | xlCommand) 1261 | #define xlcLabelProperties (436 | xlCommand) 1262 | #define xlcListboxProperties (437 | xlCommand) 1263 | #define xlcEditboxProperties (438 | xlCommand) 1264 | #define xlcPivotRefresh (439 | xlCommand) 1265 | #define xlcLinkCombo (440 | xlCommand) 1266 | #define xlcOpenText (441 | xlCommand) 1267 | #define xlcHideDialog (442 | xlCommand) 1268 | #define xlcSetDialogFocus (443 | xlCommand) 1269 | #define xlcEnableObject (444 | xlCommand) 1270 | #define xlcPushbuttonProperties (445 | xlCommand) 1271 | #define xlcSetDialogDefault (446 | xlCommand) 1272 | #define xlcFilter (447 | xlCommand) 1273 | #define xlcFilterShowAll (448 | xlCommand) 1274 | #define xlcClearOutline (449 | xlCommand) 1275 | #define xlcFunctionWizard (450 | xlCommand) 1276 | #define xlcAddListItem (451 | xlCommand) 1277 | #define xlcSetListItem (452 | xlCommand) 1278 | #define xlcRemoveListItem (453 | xlCommand) 1279 | #define xlcSelectListItem (454 | xlCommand) 1280 | #define xlcSetControlValue (455 | xlCommand) 1281 | #define xlcSaveCopyAs (456 | xlCommand) 1282 | #define xlcOptionsListsAdd (458 | xlCommand) 1283 | #define xlcOptionsListsDelete (459 | xlCommand) 1284 | #define xlcSeriesAxes (460 | xlCommand) 1285 | #define xlcSeriesX (461 | xlCommand) 1286 | #define xlcSeriesY (462 | xlCommand) 1287 | #define xlcErrorbarX (463 | xlCommand) 1288 | #define xlcErrorbarY (464 | xlCommand) 1289 | #define xlcFormatChart (465 | xlCommand) 1290 | #define xlcSeriesOrder (466 | xlCommand) 1291 | #define xlcMailLogoff (467 | xlCommand) 1292 | #define xlcClearRoutingSlip (468 | xlCommand) 1293 | #define xlcAppActivateMicrosoft (469 | xlCommand) 1294 | #define xlcMailEditMailer (470 | xlCommand) 1295 | #define xlcOnSheet (471 | xlCommand) 1296 | #define xlcStandardWidth (472 | xlCommand) 1297 | #define xlcScenarioMerge (473 | xlCommand) 1298 | #define xlcSummaryInfo (474 | xlCommand) 1299 | #define xlcFindFile (475 | xlCommand) 1300 | #define xlcActiveCellFont (476 | xlCommand) 1301 | #define xlcEnableTipwizard (477 | xlCommand) 1302 | #define xlcVbaMakeAddin (478 | xlCommand) 1303 | #define xlcInsertdatatable (480 | xlCommand) 1304 | #define xlcWorkgroupOptions (481 | xlCommand) 1305 | #define xlcMailSendMailer (482 | xlCommand) 1306 | #define xlcAutocorrect (485 | xlCommand) 1307 | #define xlcPostDocument (489 | xlCommand) 1308 | #define xlcPicklist (491 | xlCommand) 1309 | #define xlcViewShow (493 | xlCommand) 1310 | #define xlcViewDefine (494 | xlCommand) 1311 | #define xlcViewDelete (495 | xlCommand) 1312 | #define xlcSheetBackground (509 | xlCommand) 1313 | #define xlcInsertMapObject (510 | xlCommand) 1314 | #define xlcOptionsMenono (511 | xlCommand) 1315 | #define xlcNormal (518 | xlCommand) 1316 | #define xlcLayout (519 | xlCommand) 1317 | #define xlcRmPrintArea (520 | xlCommand) 1318 | #define xlcClearPrintArea (521 | xlCommand) 1319 | #define xlcAddPrintArea (522 | xlCommand) 1320 | #define xlcMoveBrk (523 | xlCommand) 1321 | #define xlcHidecurrNote (545 | xlCommand) 1322 | #define xlcHideallNotes (546 | xlCommand) 1323 | #define xlcDeleteNote (547 | xlCommand) 1324 | #define xlcTraverseNotes (548 | xlCommand) 1325 | #define xlcActivateNotes (549 | xlCommand) 1326 | #define xlcProtectRevisions (620 | xlCommand) 1327 | #define xlcUnprotectRevisions (621 | xlCommand) 1328 | #define xlcOptionsMe (647 | xlCommand) 1329 | #define xlcWebPublish (653 | xlCommand) 1330 | #define xlcNewwebquery (667 | xlCommand) 1331 | #define xlcPivotTableChart (673 | xlCommand) 1332 | #define xlcOptionsSave (753 | xlCommand) 1333 | #define xlcOptionsSpell (755 | xlCommand) 1334 | #define xlcHideallInkannots (808 | xlCommand) 1335 | --------------------------------------------------------------------------------