ExcelMagic.py 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  1. # -*- coding: ascii -*-
  2. """
  3. lots of Excel Magic Numbers
  4. """
  5. # Boundaries BIFF8+
  6. MAX_ROW = 65536
  7. MAX_COL = 256
  8. biff_records = {
  9. 0x0000: "DIMENSIONS",
  10. 0x0001: "BLANK",
  11. 0x0002: "INTEGER",
  12. 0x0003: "NUMBER",
  13. 0x0004: "LABEL",
  14. 0x0005: "BOOLERR",
  15. 0x0006: "FORMULA",
  16. 0x0007: "STRING",
  17. 0x0008: "ROW",
  18. 0x0009: "BOF",
  19. 0x000A: "EOF",
  20. 0x000B: "INDEX",
  21. 0x000C: "CALCCOUNT",
  22. 0x000D: "CALCMODE",
  23. 0x000E: "PRECISION",
  24. 0x000F: "REFMODE",
  25. 0x0010: "DELTA",
  26. 0x0011: "ITERATION",
  27. 0x0012: "PROTECT",
  28. 0x0013: "PASSWORD",
  29. 0x0014: "HEADER",
  30. 0x0015: "FOOTER",
  31. 0x0016: "EXTERNCOUNT",
  32. 0x0017: "EXTERNSHEET",
  33. 0x0018: "NAME",
  34. 0x0019: "WINDOWPROTECT",
  35. 0x001A: "VERTICALPAGEBREAKS",
  36. 0x001B: "HORIZONTALPAGEBREAKS",
  37. 0x001C: "NOTE",
  38. 0x001D: "SELECTION",
  39. 0x001E: "FORMAT",
  40. 0x001F: "FORMATCOUNT",
  41. 0x0020: "COLUMNDEFAULT",
  42. 0x0021: "ARRAY",
  43. 0x0022: "1904",
  44. 0x0023: "EXTERNNAME",
  45. 0x0024: "COLWIDTH",
  46. 0x0025: "DEFAULTROWHEIGHT",
  47. 0x0026: "LEFTMARGIN",
  48. 0x0027: "RIGHTMARGIN",
  49. 0x0028: "TOPMARGIN",
  50. 0x0029: "BOTTOMMARGIN",
  51. 0x002A: "PRINTHEADERS",
  52. 0x002B: "PRINTGRIDLINES",
  53. 0x002F: "FILEPASS",
  54. 0x0031: "FONT",
  55. 0x0036: "TABLE",
  56. 0x003C: "CONTINUE",
  57. 0x003D: "WINDOW1",
  58. 0x003E: "WINDOW2",
  59. 0x0040: "BACKUP",
  60. 0x0041: "PANE",
  61. 0x0042: "CODEPAGE",
  62. 0x0043: "XF",
  63. 0x0044: "IXFE",
  64. 0x0045: "EFONT",
  65. 0x004D: "PLS",
  66. 0x0050: "DCON",
  67. 0x0051: "DCONREF",
  68. 0x0053: "DCONNAME",
  69. 0x0055: "DEFCOLWIDTH",
  70. 0x0056: "BUILTINFMTCNT",
  71. 0x0059: "XCT",
  72. 0x005A: "CRN",
  73. 0x005B: "FILESHARING",
  74. 0x005C: "WRITEACCESS",
  75. 0x005D: "OBJ",
  76. 0x005E: "UNCALCED",
  77. 0x005F: "SAFERECALC",
  78. 0x0060: "TEMPLATE",
  79. 0x0063: "OBJPROTECT",
  80. 0x007D: "COLINFO",
  81. 0x007E: "RK",
  82. 0x007F: "IMDATA",
  83. 0x0080: "GUTS",
  84. 0x0081: "WSBOOL",
  85. 0x0082: "GRIDSET",
  86. 0x0083: "HCENTER",
  87. 0x0084: "VCENTER",
  88. 0x0085: "BOUNDSHEET",
  89. 0x0086: "WRITEPROT",
  90. 0x0087: "ADDIN",
  91. 0x0088: "EDG",
  92. 0x0089: "PUB",
  93. 0x008C: "COUNTRY",
  94. 0x008D: "HIDEOBJ",
  95. 0x008E: "BUNDLESOFFSET",
  96. 0x008F: "BUNDLEHEADER",
  97. 0x0090: "SORT",
  98. 0x0091: "SUB",
  99. 0x0092: "PALETTE",
  100. 0x0093: "STYLE",
  101. 0x0094: "LHRECORD",
  102. 0x0095: "LHNGRAPH",
  103. 0x0096: "SOUND",
  104. 0x0098: "LPR",
  105. 0x0099: "STANDARDWIDTH",
  106. 0x009A: "FNGROUPNAME",
  107. 0x009B: "FILTERMODE",
  108. 0x009C: "FNGROUPCOUNT",
  109. 0x009D: "AUTOFILTERINFO",
  110. 0x009E: "AUTOFILTER",
  111. 0x00A0: "SCL",
  112. 0x00A1: "SETUP",
  113. 0x00A9: "COORDLIST",
  114. 0x00AB: "GCW",
  115. 0x00AE: "SCENMAN",
  116. 0x00AF: "SCENARIO",
  117. 0x00B0: "SXVIEW",
  118. 0x00B1: "SXVD",
  119. 0x00B2: "SXVI",
  120. 0x00B4: "SXIVD",
  121. 0x00B5: "SXLI",
  122. 0x00B6: "SXPI",
  123. 0x00B8: "DOCROUTE",
  124. 0x00B9: "RECIPNAME",
  125. 0x00BC: "SHRFMLA",
  126. 0x00BD: "MULRK",
  127. 0x00BE: "MULBLANK",
  128. 0x00C1: "MMS",
  129. 0x00C2: "ADDMENU",
  130. 0x00C3: "DELMENU",
  131. 0x00C5: "SXDI",
  132. 0x00C6: "SXDB",
  133. 0x00C7: "SXFIELD",
  134. 0x00C8: "SXINDEXLIST",
  135. 0x00C9: "SXDOUBLE",
  136. 0x00CD: "SXSTRING",
  137. 0x00CE: "SXDATETIME",
  138. 0x00D0: "SXTBL",
  139. 0x00D1: "SXTBRGITEM",
  140. 0x00D2: "SXTBPG",
  141. 0x00D3: "OBPROJ",
  142. 0x00D5: "SXIDSTM",
  143. 0x00D6: "RSTRING",
  144. 0x00D7: "DBCELL",
  145. 0x00DA: "BOOKBOOL",
  146. 0x00DC: "SXEXT|PARAMQRY",
  147. 0x00DD: "SCENPROTECT",
  148. 0x00DE: "OLESIZE",
  149. 0x00DF: "UDDESC",
  150. 0x00E0: "XF",
  151. 0x00E1: "INTERFACEHDR",
  152. 0x00E2: "INTERFACEEND",
  153. 0x00E3: "SXVS",
  154. 0x00E5: "MERGEDCELLS",
  155. 0x00E9: "BITMAP",
  156. 0x00EB: "MSODRAWINGGROUP",
  157. 0x00EC: "MSODRAWING",
  158. 0x00ED: "MSODRAWINGSELECTION",
  159. 0x00F0: "SXRULE",
  160. 0x00F1: "SXEX",
  161. 0x00F2: "SXFILT",
  162. 0x00F6: "SXNAME",
  163. 0x00F7: "SXSELECT",
  164. 0x00F8: "SXPAIR",
  165. 0x00F9: "SXFMLA",
  166. 0x00FB: "SXFORMAT",
  167. 0x00FC: "SST",
  168. 0x00FD: "LABELSST",
  169. 0x00FF: "EXTSST",
  170. 0x0100: "SXVDEX",
  171. 0x0103: "SXFORMULA",
  172. 0x0122: "SXDBEX",
  173. 0x0137: "CHTRINSERT",
  174. 0x0138: "CHTRINFO",
  175. 0x013B: "CHTRCELLCONTENT",
  176. 0x013D: "TABID",
  177. 0x0140: "CHTRMOVERANGE",
  178. 0x014D: "CHTRINSERTTAB",
  179. 0x015F: "LABELRANGES",
  180. 0x0160: "USESELFS",
  181. 0x0161: "DSF",
  182. 0x0162: "XL5MODIFY",
  183. 0x0196: "CHTRHEADER",
  184. 0x01A9: "USERBVIEW",
  185. 0x01AA: "USERSVIEWBEGIN",
  186. 0x01AB: "USERSVIEWEND",
  187. 0x01AD: "QSI",
  188. 0x01AE: "SUPBOOK",
  189. 0x01AF: "PROT4REV",
  190. 0x01B0: "CONDFMT",
  191. 0x01B1: "CF",
  192. 0x01B2: "DVAL",
  193. 0x01B5: "DCONBIN",
  194. 0x01B6: "TXO",
  195. 0x01B7: "REFRESHALL",
  196. 0x01B8: "HLINK",
  197. 0x01BA: "CODENAME",
  198. 0x01BB: "SXFDBTYPE",
  199. 0x01BC: "PROT4REVPASS",
  200. 0x01BE: "DV",
  201. 0x01C0: "XL9FILE",
  202. 0x01C1: "RECALCID",
  203. 0x0200: "DIMENSIONS",
  204. 0x0201: "BLANK",
  205. 0x0203: "NUMBER",
  206. 0x0204: "LABEL",
  207. 0x0205: "BOOLERR",
  208. 0x0206: "FORMULA",
  209. 0x0207: "STRING",
  210. 0x0208: "ROW",
  211. 0x0209: "BOF",
  212. 0x020B: "INDEX",
  213. 0x0218: "NAME",
  214. 0x0221: "ARRAY",
  215. 0x0223: "EXTERNNAME",
  216. 0x0225: "DEFAULTROWHEIGHT",
  217. 0x0231: "FONT",
  218. 0x0236: "TABLE",
  219. 0x023E: "WINDOW2",
  220. 0x0243: "XF",
  221. 0x027E: "RK",
  222. 0x0293: "STYLE",
  223. 0x0406: "FORMULA",
  224. 0x0409: "BOF",
  225. 0x041E: "FORMAT",
  226. 0x0443: "XF",
  227. 0x04BC: "SHRFMLA",
  228. 0x0800: "SCREENTIP",
  229. 0x0803: "WEBQRYSETTINGS",
  230. 0x0804: "WEBQRYTABLES",
  231. 0x0809: "BOF",
  232. 0x0862: "SHEETLAYOUT",
  233. 0x0867: "SHEETPROTECTION",
  234. 0x1001: "UNITS",
  235. 0x1002: "ChartChart",
  236. 0x1003: "ChartSeries",
  237. 0x1006: "ChartDataformat",
  238. 0x1007: "ChartLineformat",
  239. 0x1009: "ChartMarkerformat",
  240. 0x100A: "ChartAreaformat",
  241. 0x100B: "ChartPieformat",
  242. 0x100C: "ChartAttachedlabel",
  243. 0x100D: "ChartSeriestext",
  244. 0x1014: "ChartChartformat",
  245. 0x1015: "ChartLegend",
  246. 0x1016: "ChartSerieslist",
  247. 0x1017: "ChartBar",
  248. 0x1018: "ChartLine",
  249. 0x1019: "ChartPie",
  250. 0x101A: "ChartArea",
  251. 0x101B: "ChartScatter",
  252. 0x101C: "ChartChartline",
  253. 0x101D: "ChartAxis",
  254. 0x101E: "ChartTick",
  255. 0x101F: "ChartValuerange",
  256. 0x1020: "ChartCatserrange",
  257. 0x1021: "ChartAxislineformat",
  258. 0x1022: "ChartFormatlink",
  259. 0x1024: "ChartDefaulttext",
  260. 0x1025: "ChartText",
  261. 0x1026: "ChartFontx",
  262. 0x1027: "ChartObjectLink",
  263. 0x1032: "ChartFrame",
  264. 0x1033: "BEGIN",
  265. 0x1034: "END",
  266. 0x1035: "ChartPlotarea",
  267. 0x103A: "Chart3D",
  268. 0x103C: "ChartPicf",
  269. 0x103D: "ChartDropbar",
  270. 0x103E: "ChartRadar",
  271. 0x103F: "ChartSurface",
  272. 0x1040: "ChartRadararea",
  273. 0x1041: "ChartAxisparent",
  274. 0x1043: "ChartLegendxn",
  275. 0x1044: "ChartShtprops",
  276. 0x1045: "ChartSertocrt",
  277. 0x1046: "ChartAxesused",
  278. 0x1048: "ChartSbaseref",
  279. 0x104A: "ChartSerparent",
  280. 0x104B: "ChartSerauxtrend",
  281. 0x104E: "ChartIfmt",
  282. 0x104F: "ChartPos",
  283. 0x1050: "ChartAlruns",
  284. 0x1051: "ChartAI",
  285. 0x105B: "ChartSerauxerrbar",
  286. 0x105D: "ChartSerfmt",
  287. 0x105F: "Chart3DDataFormat",
  288. 0x1060: "ChartFbi",
  289. 0x1061: "ChartBoppop",
  290. 0x1062: "ChartAxcext",
  291. 0x1063: "ChartDat",
  292. 0x1064: "ChartPlotgrowth",
  293. 0x1065: "ChartSiindex",
  294. 0x1066: "ChartGelframe",
  295. 0x1067: "ChartBoppcustom",
  296. 0xFFFF: ""
  297. }
  298. all_funcs_by_name = {
  299. # Includes Analysis ToolPak aka ATP aka add-in aka xcall functions,
  300. # distinguished by -ve opcode.
  301. # name: (opcode, min # args, max # args, func return type, func arg types)
  302. # + in func arg types means more of the same.
  303. 'ABS' : ( 24, 1, 1, 'V', 'V'),
  304. 'ACCRINT' : ( -1, 6, 7, 'V', 'VVVVVVV'),
  305. 'ACCRINTM' : ( -1, 3, 5, 'V', 'VVVVV'),
  306. 'ACOS' : ( 99, 1, 1, 'V', 'V'),
  307. 'ACOSH' : (233, 1, 1, 'V', 'V'),
  308. 'ADDRESS' : (219, 2, 5, 'V', 'VVVVV'),
  309. 'AMORDEGRC' : ( -1, 7, 7, 'V', 'VVVVVVV'),
  310. 'AMORLINC' : ( -1, 7, 7, 'V', 'VVVVVVV'),
  311. 'AND' : ( 36, 1, 30, 'V', 'D+'),
  312. 'AREAS' : ( 75, 1, 1, 'V', 'R'),
  313. 'ASC' : (214, 1, 1, 'V', 'V'),
  314. 'ASIN' : ( 98, 1, 1, 'V', 'V'),
  315. 'ASINH' : (232, 1, 1, 'V', 'V'),
  316. 'ATAN' : ( 18, 1, 1, 'V', 'V'),
  317. 'ATAN2' : ( 97, 2, 2, 'V', 'VV'),
  318. 'ATANH' : (234, 1, 1, 'V', 'V'),
  319. 'AVEDEV' : (269, 1, 30, 'V', 'D+'),
  320. 'AVERAGE' : ( 5, 1, 30, 'V', 'D+'),
  321. 'AVERAGEA' : (361, 1, 30, 'V', 'D+'),
  322. 'BAHTTEXT' : (368, 1, 1, 'V', 'V'),
  323. 'BESSELI' : ( -1, 2, 2, 'V', 'VV'),
  324. 'BESSELJ' : ( -1, 2, 2, 'V', 'VV'),
  325. 'BESSELK' : ( -1, 2, 2, 'V', 'VV'),
  326. 'BESSELY' : ( -1, 2, 2, 'V', 'VV'),
  327. 'BETADIST' : (270, 3, 5, 'V', 'VVVVV'),
  328. 'BETAINV' : (272, 3, 5, 'V', 'VVVVV'),
  329. 'BIN2DEC' : ( -1, 1, 1, 'V', 'V'),
  330. 'BIN2HEX' : ( -1, 1, 2, 'V', 'VV'),
  331. 'BIN2OCT' : ( -1, 1, 2, 'V', 'VV'),
  332. 'BINOMDIST' : (273, 4, 4, 'V', 'VVVV'),
  333. 'CEILING' : (288, 2, 2, 'V', 'VV'),
  334. 'CELL' : (125, 1, 2, 'V', 'VR'),
  335. 'CHAR' : (111, 1, 1, 'V', 'V'),
  336. 'CHIDIST' : (274, 2, 2, 'V', 'VV'),
  337. 'CHIINV' : (275, 2, 2, 'V', 'VV'),
  338. 'CHITEST' : (306, 2, 2, 'V', 'AA'),
  339. 'CHOOSE' : (100, 2, 30, 'R', 'VR+'),
  340. 'CLEAN' : (162, 1, 1, 'V', 'V'),
  341. 'CODE' : (121, 1, 1, 'V', 'V'),
  342. 'COLUMN' : ( 9, 0, 1, 'V', 'R'),
  343. 'COLUMNS' : ( 77, 1, 1, 'V', 'R'),
  344. 'COMBIN' : (276, 2, 2, 'V', 'VV'),
  345. 'COMPLEX' : ( -1, 2, 3, 'V', 'VVV'),
  346. 'CONCATENATE' : (336, 1, 30, 'V', 'V+'),
  347. 'CONFIDENCE' : (277, 3, 3, 'V', 'VVV'),
  348. 'CONVERT' : ( -1, 3, 3, 'V', 'VVV'),
  349. 'CORREL' : (307, 2, 2, 'V', 'AA'),
  350. 'COS' : ( 16, 1, 1, 'V', 'V'),
  351. 'COSH' : (230, 1, 1, 'V', 'V'),
  352. 'COUNT' : ( 0, 1, 30, 'V', 'D+'),
  353. 'COUNTA' : (169, 1, 30, 'V', 'D+'),
  354. 'COUNTBLANK' : (347, 1, 1, 'V', 'R'),
  355. 'COUNTIF' : (346, 2, 2, 'V', 'RV'),
  356. 'COUPDAYBS' : ( -1, 3, 5, 'V', 'VVVVV'),
  357. 'COUPDAYS' : ( -1, 3, 5, 'V', 'VVVVV'),
  358. 'COUPDAYSNC' : ( -1, 3, 5, 'V', 'VVVVV'),
  359. 'COUPNCD' : ( -1, 3, 5, 'V', 'VVVVV'),
  360. 'COUPNUM' : ( -1, 3, 5, 'V', 'VVVVV'),
  361. 'COUPPCD' : ( -1, 3, 5, 'V', 'VVVVV'),
  362. 'COVAR' : (308, 2, 2, 'V', 'AA'),
  363. 'CRITBINOM' : (278, 3, 3, 'V', 'VVV'),
  364. 'CUMIPMT' : ( -1, 6, 6, 'V', 'VVVVVV'),
  365. 'CUMPRINC' : ( -1, 6, 6, 'V', 'VVVVVV'),
  366. 'DATE' : ( 65, 3, 3, 'V', 'VVV'),
  367. 'DATEDIF' : (351, 3, 3, 'V', 'VVV'),
  368. 'DATEVALUE' : (140, 1, 1, 'V', 'V'),
  369. 'DAVERAGE' : ( 42, 3, 3, 'V', 'RRR'),
  370. 'DAY' : ( 67, 1, 1, 'V', 'V'),
  371. 'DAYS360' : (220, 2, 3, 'V', 'VVV'),
  372. 'DB' : (247, 4, 5, 'V', 'VVVVV'),
  373. 'DBCS' : (215, 1, 1, 'V', 'V'),
  374. 'DCOUNT' : ( 40, 3, 3, 'V', 'RRR'),
  375. 'DCOUNTA' : (199, 3, 3, 'V', 'RRR'),
  376. 'DDB' : (144, 4, 5, 'V', 'VVVVV'),
  377. 'DEC2BIN' : ( -1, 1, 2, 'V', 'VV'),
  378. 'DEC2HEX' : ( -1, 1, 2, 'V', 'VV'),
  379. 'DEC2OCT' : ( -1, 1, 2, 'V', 'VV'),
  380. 'DEGREES' : (343, 1, 1, 'V', 'V'),
  381. 'DELTA' : ( -1, 1, 2, 'V', 'VV'),
  382. 'DEVSQ' : (318, 1, 30, 'V', 'D+'),
  383. 'DGET' : (235, 3, 3, 'V', 'RRR'),
  384. 'DISC' : ( -1, 4, 5, 'V', 'VVVVV'),
  385. 'DMAX' : ( 44, 3, 3, 'V', 'RRR'),
  386. 'DMIN' : ( 43, 3, 3, 'V', 'RRR'),
  387. 'DOLLAR' : ( 13, 1, 2, 'V', 'VV'),
  388. 'DOLLARDE' : ( -1, 2, 2, 'V', 'VV'),
  389. 'DOLLARFR' : ( -1, 2, 2, 'V', 'VV'),
  390. 'DPRODUCT' : (189, 3, 3, 'V', 'RRR'),
  391. 'DSTDEV' : ( 45, 3, 3, 'V', 'RRR'),
  392. 'DSTDEVP' : (195, 3, 3, 'V', 'RRR'),
  393. 'DSUM' : ( 41, 3, 3, 'V', 'RRR'),
  394. 'DURATION' : ( -1, 5, 6, 'V', 'VVVVVV'),
  395. 'DVAR' : ( 47, 3, 3, 'V', 'RRR'),
  396. 'DVARP' : (196, 3, 3, 'V', 'RRR'),
  397. 'EDATE' : ( -1, 2, 2, 'V', 'VV'),
  398. 'EFFECT' : ( -1, 2, 2, 'V', 'VV'),
  399. 'EOMONTH' : ( -1, 1, 2, 'V', 'VV'),
  400. 'ERF' : ( -1, 1, 2, 'V', 'VV'),
  401. 'ERFC' : ( -1, 1, 1, 'V', 'V'),
  402. 'ERROR.TYPE' : (261, 1, 1, 'V', 'V'),
  403. 'EVEN' : (279, 1, 1, 'V', 'V'),
  404. 'EXACT' : (117, 2, 2, 'V', 'VV'),
  405. 'EXP' : ( 21, 1, 1, 'V', 'V'),
  406. 'EXPONDIST' : (280, 3, 3, 'V', 'VVV'),
  407. 'FACT' : (184, 1, 1, 'V', 'V'),
  408. 'FACTDOUBLE' : ( -1, 1, 1, 'V', 'V'),
  409. 'FALSE' : ( 35, 0, 0, 'V', '-'),
  410. 'FDIST' : (281, 3, 3, 'V', 'VVV'),
  411. 'FIND' : (124, 2, 3, 'V', 'VVV'),
  412. 'FINDB' : (205, 2, 3, 'V', 'VVV'),
  413. 'FINV' : (282, 3, 3, 'V', 'VVV'),
  414. 'FISHER' : (283, 1, 1, 'V', 'V'),
  415. 'FISHERINV' : (284, 1, 1, 'V', 'V'),
  416. 'FIXED' : ( 14, 2, 3, 'V', 'VVV'),
  417. 'FLOOR' : (285, 2, 2, 'V', 'VV'),
  418. 'FORECAST' : (309, 3, 3, 'V', 'VAA'),
  419. 'FREQUENCY' : (252, 2, 2, 'A', 'RR'),
  420. 'FTEST' : (310, 2, 2, 'V', 'AA'),
  421. 'FV' : ( 57, 3, 5, 'V', 'VVVVV'),
  422. 'FVSCHEDULE' : ( -1, 2, 2, 'V', 'VA'),
  423. 'GAMMADIST' : (286, 4, 4, 'V', 'VVVV'),
  424. 'GAMMAINV' : (287, 3, 3, 'V', 'VVV'),
  425. 'GAMMALN' : (271, 1, 1, 'V', 'V'),
  426. 'GCD' : ( -1, 1, 29, 'V', 'V+'),
  427. 'GEOMEAN' : (319, 1, 30, 'V', 'D+'),
  428. 'GESTEP' : ( -1, 1, 2, 'V', 'VV'),
  429. 'GETPIVOTDATA': (358, 2, 30, 'A', 'VAV+'),
  430. 'GROWTH' : ( 52, 1, 4, 'A', 'RRRV'),
  431. 'HARMEAN' : (320, 1, 30, 'V', 'D+'),
  432. 'HEX2BIN' : ( -1, 1, 2, 'V', 'VV'),
  433. 'HEX2DEC' : ( -1, 1, 1, 'V', 'V'),
  434. 'HEX2OCT' : ( -1, 1, 2, 'V', 'VV'),
  435. 'HLOOKUP' : (101, 3, 4, 'V', 'VRRV'),
  436. 'HOUR' : ( 71, 1, 1, 'V', 'V'),
  437. 'HYPERLINK' : (359, 1, 2, 'V', 'VV'),
  438. 'HYPGEOMDIST' : (289, 4, 4, 'V', 'VVVV'),
  439. 'IF' : ( 1, 2, 3, 'R', 'VRR'),
  440. 'IMABS' : ( -1, 1, 1, 'V', 'V'),
  441. 'IMAGINARY' : ( -1, 1, 1, 'V', 'V'),
  442. 'IMARGUMENT' : ( -1, 1, 1, 'V', 'V'),
  443. 'IMCONJUGATE' : ( -1, 1, 1, 'V', 'V'),
  444. 'IMCOS' : ( -1, 1, 1, 'V', 'V'),
  445. 'IMDIV' : ( -1, 2, 2, 'V', 'VV'),
  446. 'IMEXP' : ( -1, 1, 1, 'V', 'V'),
  447. 'IMLN' : ( -1, 1, 1, 'V', 'V'),
  448. 'IMLOG10' : ( -1, 1, 1, 'V', 'V'),
  449. 'IMLOG2' : ( -1, 1, 1, 'V', 'V'),
  450. 'IMPOWER' : ( -1, 2, 2, 'V', 'VV'),
  451. 'IMPRODUCT' : ( -1, 2, 2, 'V', 'VV'),
  452. 'IMREAL' : ( -1, 1, 1, 'V', 'V'),
  453. 'IMSIN' : ( -1, 1, 1, 'V', 'V'),
  454. 'IMSQRT' : ( -1, 1, 1, 'V', 'V'),
  455. 'IMSUB' : ( -1, 2, 2, 'V', 'VV'),
  456. 'IMSUM' : ( -1, 1, 29, 'V', 'V+'),
  457. 'INDEX' : ( 29, 2, 4, 'R', 'RVVV'),
  458. 'INDIRECT' : (148, 1, 2, 'R', 'VV'),
  459. 'INFO' : (244, 1, 1, 'V', 'V'),
  460. 'INT' : ( 25, 1, 1, 'V', 'V'),
  461. 'INTERCEPT' : (311, 2, 2, 'V', 'AA'),
  462. 'INTRATE' : ( -1, 4, 5, 'V', 'VVVVV'),
  463. 'IPMT' : (167, 4, 6, 'V', 'VVVVVV'),
  464. 'IRR' : ( 62, 1, 2, 'V', 'RV'),
  465. 'ISBLANK' : (129, 1, 1, 'V', 'V'),
  466. 'ISERR' : (126, 1, 1, 'V', 'V'),
  467. 'ISERROR' : ( 3, 1, 1, 'V', 'V'),
  468. 'ISEVEN' : ( -1, 1, 1, 'V', 'V'),
  469. 'ISLOGICAL' : (198, 1, 1, 'V', 'V'),
  470. 'ISNA' : ( 2, 1, 1, 'V', 'V'),
  471. 'ISNONTEXT' : (190, 1, 1, 'V', 'V'),
  472. 'ISNUMBER' : (128, 1, 1, 'V', 'V'),
  473. 'ISODD' : ( -1, 1, 1, 'V', 'V'),
  474. 'ISPMT' : (350, 4, 4, 'V', 'VVVV'),
  475. 'ISREF' : (105, 1, 1, 'V', 'R'),
  476. 'ISTEXT' : (127, 1, 1, 'V', 'V'),
  477. 'KURT' : (322, 1, 30, 'V', 'D+'),
  478. 'LARGE' : (325, 2, 2, 'V', 'RV'),
  479. 'LCM' : ( -1, 1, 29, 'V', 'V+'),
  480. 'LEFT' : (115, 1, 2, 'V', 'VV'),
  481. 'LEFTB' : (208, 1, 2, 'V', 'VV'),
  482. 'LEN' : ( 32, 1, 1, 'V', 'V'),
  483. 'LENB' : (211, 1, 1, 'V', 'V'),
  484. 'LINEST' : ( 49, 1, 4, 'A', 'RRVV'),
  485. 'LN' : ( 22, 1, 1, 'V', 'V'),
  486. 'LOG' : (109, 1, 2, 'V', 'VV'),
  487. 'LOG10' : ( 23, 1, 1, 'V', 'V'),
  488. 'LOGEST' : ( 51, 1, 4, 'A', 'RRVV'),
  489. 'LOGINV' : (291, 3, 3, 'V', 'VVV'),
  490. 'LOGNORMDIST' : (290, 3, 3, 'V', 'VVV'),
  491. 'LOOKUP' : ( 28, 2, 3, 'V', 'VRR'),
  492. 'LOWER' : (112, 1, 1, 'V', 'V'),
  493. 'MATCH' : ( 64, 2, 3, 'V', 'VRR'),
  494. 'MAX' : ( 7, 1, 30, 'V', 'D+'),
  495. 'MAXA' : (362, 1, 30, 'V', 'D+'),
  496. 'MDETERM' : (163, 1, 1, 'V', 'A'),
  497. 'MDURATION' : ( -1, 5, 6, 'V', 'VVVVVV'),
  498. 'MEDIAN' : (227, 1, 30, 'V', 'D+'),
  499. 'MID' : ( 31, 3, 3, 'V', 'VVV'),
  500. 'MIDB' : (210, 3, 3, 'V', 'VVV'),
  501. 'MIN' : ( 6, 1, 30, 'V', 'D+'),
  502. 'MINA' : (363, 1, 30, 'V', 'D+'),
  503. 'MINUTE' : ( 72, 1, 1, 'V', 'V'),
  504. 'MINVERSE' : (164, 1, 1, 'A', 'A'),
  505. 'MIRR' : ( 61, 3, 3, 'V', 'RVV'),
  506. 'MMULT' : (165, 2, 2, 'A', 'AA'),
  507. 'MOD' : ( 39, 2, 2, 'V', 'VV'),
  508. 'MODE' : (330, 1, 30, 'V', 'A+'), ################ weird #################
  509. 'MONTH' : ( 68, 1, 1, 'V', 'V'),
  510. 'MROUND' : ( -1, 2, 2, 'V', 'VV'),
  511. 'MULTINOMIAL' : ( -1, 1, 29, 'V', 'V+'),
  512. 'N' : (131, 1, 1, 'V', 'R'),
  513. 'NA' : ( 10, 0, 0, 'V', '-'),
  514. 'NEGBINOMDIST': (292, 3, 3, 'V', 'VVV'),
  515. 'NETWORKDAYS' : ( -1, 2, 3, 'V', 'VVR'),
  516. 'NOMINAL' : ( -1, 2, 2, 'V', 'VV'),
  517. 'NORMDIST' : (293, 4, 4, 'V', 'VVVV'),
  518. 'NORMINV' : (295, 3, 3, 'V', 'VVV'),
  519. 'NORMSDIST' : (294, 1, 1, 'V', 'V'),
  520. 'NORMSINV' : (296, 1, 1, 'V', 'V'),
  521. 'NOT' : ( 38, 1, 1, 'V', 'V'),
  522. 'NOW' : ( 74, 0, 0, 'V', '-'),
  523. 'NPER' : ( 58, 3, 5, 'V', 'VVVVV'),
  524. 'NPV' : ( 11, 2, 30, 'V', 'VD+'),
  525. 'OCT2BIN' : ( -1, 1, 2, 'V', 'VV'),
  526. 'OCT2DEC' : ( -1, 1, 1, 'V', 'V'),
  527. 'OCT2HEX' : ( -1, 1, 2, 'V', 'VV'),
  528. 'ODD' : (298, 1, 1, 'V', 'V'),
  529. 'ODDFPRICE' : ( -1, 9, 9, 'V', 'VVVVVVVVV'),
  530. 'ODDFYIELD' : ( -1, 9, 9, 'V', 'VVVVVVVVV'),
  531. 'ODDLPRICE' : ( -1, 8, 8, 'V', 'VVVVVVVV'),
  532. 'ODDLYIELD' : ( -1, 8, 8, 'V', 'VVVVVVVV'),
  533. 'OFFSET' : ( 78, 3, 5, 'R', 'RVVVV'),
  534. 'OR' : ( 37, 1, 30, 'V', 'D+'),
  535. 'PEARSON' : (312, 2, 2, 'V', 'AA'),
  536. 'PERCENTILE' : (328, 2, 2, 'V', 'RV'),
  537. 'PERCENTRANK' : (329, 2, 3, 'V', 'RVV'),
  538. 'PERMUT' : (299, 2, 2, 'V', 'VV'),
  539. 'PHONETIC' : (360, 1, 1, 'V', 'R'),
  540. 'PI' : ( 19, 0, 0, 'V', '-'),
  541. 'PMT' : ( 59, 3, 5, 'V', 'VVVVV'),
  542. 'POISSON' : (300, 3, 3, 'V', 'VVV'),
  543. 'POWER' : (337, 2, 2, 'V', 'VV'),
  544. 'PPMT' : (168, 4, 6, 'V', 'VVVVVV'),
  545. 'PRICE' : ( -1, 6, 7, 'V', 'VVVVVVV'),
  546. 'PRICEDISC' : ( -1, 4, 5, 'V', 'VVVVV'),
  547. 'PRICEMAT' : ( -1, 5, 6, 'V', 'VVVVVV'),
  548. 'PROB' : (317, 3, 4, 'V', 'AAVV'),
  549. 'PRODUCT' : (183, 1, 30, 'V', 'D+'),
  550. 'PROPER' : (114, 1, 1, 'V', 'V'),
  551. 'PV' : ( 56, 3, 5, 'V', 'VVVVV'),
  552. 'QUARTILE' : (327, 2, 2, 'V', 'RV'),
  553. 'QUOTIENT' : ( -1, 2, 2, 'V', 'VV'),
  554. 'RADIANS' : (342, 1, 1, 'V', 'V'),
  555. 'RAND' : ( 63, 0, 0, 'V', '-'),
  556. 'RANDBETWEEN' : ( -1, 2, 2, 'V', 'VV'),
  557. 'RANK' : (216, 2, 3, 'V', 'VRV'),
  558. 'RATE' : ( 60, 3, 6, 'V', 'VVVVVV'),
  559. 'RECEIVED' : ( -1, 4, 5, 'V', 'VVVVV'),
  560. 'REPLACE' : (119, 4, 4, 'V', 'VVVV'),
  561. 'REPLACEB' : (207, 4, 4, 'V', 'VVVV'),
  562. 'REPT' : ( 30, 2, 2, 'V', 'VV'),
  563. 'RIGHT' : (116, 1, 2, 'V', 'VV'),
  564. 'RIGHTB' : (209, 1, 2, 'V', 'VV'),
  565. 'ROMAN' : (354, 1, 2, 'V', 'VV'),
  566. 'ROUND' : ( 27, 2, 2, 'V', 'VV'),
  567. 'ROUNDDOWN' : (213, 2, 2, 'V', 'VV'),
  568. 'ROUNDUP' : (212, 2, 2, 'V', 'VV'),
  569. 'ROW' : ( 8, 0, 1, 'V', 'R'),
  570. 'ROWS' : ( 76, 1, 1, 'V', 'R'),
  571. 'RSQ' : (313, 2, 2, 'V', 'AA'),
  572. 'RTD' : (379, 3, 30, 'A', 'VVV+'),
  573. 'SEARCH' : ( 82, 2, 3, 'V', 'VVV'),
  574. 'SEARCHB' : (206, 2, 3, 'V', 'VVV'),
  575. 'SECOND' : ( 73, 1, 1, 'V', 'V'),
  576. 'SERIESSUM' : ( -1, 4, 4, 'V', 'VVVA'),
  577. 'SIGN' : ( 26, 1, 1, 'V', 'V'),
  578. 'SIN' : ( 15, 1, 1, 'V', 'V'),
  579. 'SINH' : (229, 1, 1, 'V', 'V'),
  580. 'SKEW' : (323, 1, 30, 'V', 'D+'),
  581. 'SLN' : (142, 3, 3, 'V', 'VVV'),
  582. 'SLOPE' : (315, 2, 2, 'V', 'AA'),
  583. 'SMALL' : (326, 2, 2, 'V', 'RV'),
  584. 'SQRT' : ( 20, 1, 1, 'V', 'V'),
  585. 'SQRTPI' : ( -1, 1, 1, 'V', 'V'),
  586. 'STANDARDIZE' : (297, 3, 3, 'V', 'VVV'),
  587. 'STDEV' : ( 12, 1, 30, 'V', 'D+'),
  588. 'STDEVA' : (366, 1, 30, 'V', 'D+'),
  589. 'STDEVP' : (193, 1, 30, 'V', 'D+'),
  590. 'STDEVPA' : (364, 1, 30, 'V', 'D+'),
  591. 'STEYX' : (314, 2, 2, 'V', 'AA'),
  592. 'SUBSTITUTE' : (120, 3, 4, 'V', 'VVVV'),
  593. 'SUBTOTAL' : (344, 2, 30, 'V', 'VR+'),
  594. 'SUM' : ( 4, 1, 30, 'V', 'D+'),
  595. 'SUMIF' : (345, 2, 3, 'V', 'RVR'),
  596. 'SUMPRODUCT' : (228, 1, 30, 'V', 'A+'),
  597. 'SUMSQ' : (321, 1, 30, 'V', 'D+'),
  598. 'SUMX2MY2' : (304, 2, 2, 'V', 'AA'),
  599. 'SUMX2PY2' : (305, 2, 2, 'V', 'AA'),
  600. 'SUMXMY2' : (303, 2, 2, 'V', 'AA'),
  601. 'SYD' : (143, 4, 4, 'V', 'VVVV'),
  602. 'T' : (130, 1, 1, 'V', 'R'),
  603. 'TAN' : ( 17, 1, 1, 'V', 'V'),
  604. 'TANH' : (231, 1, 1, 'V', 'V'),
  605. 'TBILLEQ' : ( -1, 3, 3, 'V', 'VVV'),
  606. 'TBILLPRICE' : ( -1, 3, 3, 'V', 'VVV'),
  607. 'TBILLYIELD' : ( -1, 3, 3, 'V', 'VVV'),
  608. 'TDIST' : (301, 3, 3, 'V', 'VVV'),
  609. 'TEXT' : ( 48, 2, 2, 'V', 'VV'),
  610. 'TIME' : ( 66, 3, 3, 'V', 'VVV'),
  611. 'TIMEVALUE' : (141, 1, 1, 'V', 'V'),
  612. 'TINV' : (332, 2, 2, 'V', 'VV'),
  613. 'TODAY' : (221, 0, 0, 'V', '-'),
  614. 'TRANSPOSE' : ( 83, 1, 1, 'A', 'A'),
  615. 'TREND' : ( 50, 1, 4, 'A', 'RRRV'),
  616. 'TRIM' : (118, 1, 1, 'V', 'V'),
  617. 'TRIMMEAN' : (331, 2, 2, 'V', 'RV'),
  618. 'TRUE' : ( 34, 0, 0, 'V', '-'),
  619. 'TRUNC' : (197, 1, 2, 'V', 'VV'),
  620. 'TTEST' : (316, 4, 4, 'V', 'AAVV'),
  621. 'TYPE' : ( 86, 1, 1, 'V', 'V'),
  622. 'UPPER' : (113, 1, 1, 'V', 'V'),
  623. 'USDOLLAR' : (204, 1, 2, 'V', 'VV'),
  624. 'VALUE' : ( 33, 1, 1, 'V', 'V'),
  625. 'VAR' : ( 46, 1, 30, 'V', 'D+'),
  626. 'VARA' : (367, 1, 30, 'V', 'D+'),
  627. 'VARP' : (194, 1, 30, 'V', 'D+'),
  628. 'VARPA' : (365, 1, 30, 'V', 'D+'),
  629. 'VDB' : (222, 5, 7, 'V', 'VVVVVVV'),
  630. 'VLOOKUP' : (102, 3, 4, 'V', 'VRRV'),
  631. 'WEEKDAY' : ( 70, 1, 2, 'V', 'VV'),
  632. 'WEEKNUM' : ( -1, 1, 2, 'V', 'VV'),
  633. 'WEIBULL' : (302, 4, 4, 'V', 'VVVV'),
  634. 'WORKDAY' : ( -1, 2, 3, 'V', 'VVR'),
  635. 'XIRR' : ( -1, 2, 3, 'V', 'AAV'),
  636. 'XNPV' : ( -1, 3, 3, 'V', 'VAA'),
  637. 'YEAR' : ( 69, 1, 1, 'V', 'V'),
  638. 'YEARFRAC' : ( -1, 2, 3, 'V', 'VVV'),
  639. 'YIELD' : ( -1, 6, 7, 'V', 'VVVVVVV'),
  640. 'YIELDDISC' : ( -1, 4, 5, 'V', 'VVVVV'),
  641. 'YIELDMAT' : ( -1, 5, 6, 'V', 'VVVVVV'),
  642. 'ZTEST' : (324, 2, 3, 'V', 'RVV'),
  643. }
  644. # Formulas Parse things
  645. ptgExp = 0x01
  646. ptgTbl = 0x02
  647. ptgAdd = 0x03
  648. ptgSub = 0x04
  649. ptgMul = 0x05
  650. ptgDiv = 0x06
  651. ptgPower = 0x07
  652. ptgConcat = 0x08
  653. ptgLT = 0x09
  654. ptgLE = 0x0a
  655. ptgEQ = 0x0b
  656. ptgGE = 0x0c
  657. ptgGT = 0x0d
  658. ptgNE = 0x0e
  659. ptgIsect = 0x0f
  660. ptgUnion = 0x10
  661. ptgRange = 0x11
  662. ptgUplus = 0x12
  663. ptgUminus = 0x13
  664. ptgPercent = 0x14
  665. ptgParen = 0x15
  666. ptgMissArg = 0x16
  667. ptgStr = 0x17
  668. ptgExtend = 0x18
  669. ptgAttr = 0x19
  670. ptgSheet = 0x1a
  671. ptgEndSheet = 0x1b
  672. ptgErr = 0x1c
  673. ptgBool = 0x1d
  674. ptgInt = 0x1e
  675. ptgNum = 0x1f
  676. ptgArrayR = 0x20
  677. ptgFuncR = 0x21
  678. ptgFuncVarR = 0x22
  679. ptgNameR = 0x23
  680. ptgRefR = 0x24
  681. ptgAreaR = 0x25
  682. ptgMemAreaR = 0x26
  683. ptgMemErrR = 0x27
  684. ptgMemNoMemR = 0x28
  685. ptgMemFuncR = 0x29
  686. ptgRefErrR = 0x2a
  687. ptgAreaErrR = 0x2b
  688. ptgRefNR = 0x2c
  689. ptgAreaNR = 0x2d
  690. ptgMemAreaNR = 0x2e
  691. ptgMemNoMemNR = 0x2f
  692. ptgNameXR = 0x39
  693. ptgRef3dR = 0x3a
  694. ptgArea3dR = 0x3b
  695. ptgRefErr3dR = 0x3c
  696. ptgAreaErr3dR = 0x3d
  697. ptgArrayV = 0x40
  698. ptgFuncV = 0x41
  699. ptgFuncVarV = 0x42
  700. ptgNameV = 0x43
  701. ptgRefV = 0x44
  702. ptgAreaV = 0x45
  703. ptgMemAreaV = 0x46
  704. ptgMemErrV = 0x47
  705. ptgMemNoMemV = 0x48
  706. ptgMemFuncV = 0x49
  707. ptgRefErrV = 0x4a
  708. ptgAreaErrV = 0x4b
  709. ptgRefNV = 0x4c
  710. ptgAreaNV = 0x4d
  711. ptgMemAreaNV = 0x4e
  712. ptgMemNoMemNV = 0x4f
  713. ptgFuncCEV = 0x58
  714. ptgNameXV = 0x59
  715. ptgRef3dV = 0x5a
  716. ptgArea3dV = 0x5b
  717. ptgRefErr3dV = 0x5c
  718. ptgAreaErr3dV = 0x5d
  719. ptgArrayA = 0x60
  720. ptgFuncA = 0x61
  721. ptgFuncVarA = 0x62
  722. ptgNameA = 0x63
  723. ptgRefA = 0x64
  724. ptgAreaA = 0x65
  725. ptgMemAreaA = 0x66
  726. ptgMemErrA = 0x67
  727. ptgMemNoMemA = 0x68
  728. ptgMemFuncA = 0x69
  729. ptgRefErrA = 0x6a
  730. ptgAreaErrA = 0x6b
  731. ptgRefNA = 0x6c
  732. ptgAreaNA = 0x6d
  733. ptgMemAreaNA = 0x6e
  734. ptgMemNoMemNA = 0x6f
  735. ptgFuncCEA = 0x78
  736. ptgNameXA = 0x79
  737. ptgRef3dA = 0x7a
  738. ptgArea3dA = 0x7b
  739. ptgRefErr3dA = 0x7c
  740. ptgAreaErr3dA = 0x7d
  741. PtgNames = {
  742. ptgExp : "ptgExp",
  743. ptgTbl : "ptgTbl",
  744. ptgAdd : "ptgAdd",
  745. ptgSub : "ptgSub",
  746. ptgMul : "ptgMul",
  747. ptgDiv : "ptgDiv",
  748. ptgPower : "ptgPower",
  749. ptgConcat : "ptgConcat",
  750. ptgLT : "ptgLT",
  751. ptgLE : "ptgLE",
  752. ptgEQ : "ptgEQ",
  753. ptgGE : "ptgGE",
  754. ptgGT : "ptgGT",
  755. ptgNE : "ptgNE",
  756. ptgIsect : "ptgIsect",
  757. ptgUnion : "ptgUnion",
  758. ptgRange : "ptgRange",
  759. ptgUplus : "ptgUplus",
  760. ptgUminus : "ptgUminus",
  761. ptgPercent : "ptgPercent",
  762. ptgParen : "ptgParen",
  763. ptgMissArg : "ptgMissArg",
  764. ptgStr : "ptgStr",
  765. ptgExtend : "ptgExtend",
  766. ptgAttr : "ptgAttr",
  767. ptgSheet : "ptgSheet",
  768. ptgEndSheet : "ptgEndSheet",
  769. ptgErr : "ptgErr",
  770. ptgBool : "ptgBool",
  771. ptgInt : "ptgInt",
  772. ptgNum : "ptgNum",
  773. ptgArrayR : "ptgArrayR",
  774. ptgFuncR : "ptgFuncR",
  775. ptgFuncVarR : "ptgFuncVarR",
  776. ptgNameR : "ptgNameR",
  777. ptgRefR : "ptgRefR",
  778. ptgAreaR : "ptgAreaR",
  779. ptgMemAreaR : "ptgMemAreaR",
  780. ptgMemErrR : "ptgMemErrR",
  781. ptgMemNoMemR : "ptgMemNoMemR",
  782. ptgMemFuncR : "ptgMemFuncR",
  783. ptgRefErrR : "ptgRefErrR",
  784. ptgAreaErrR : "ptgAreaErrR",
  785. ptgRefNR : "ptgRefNR",
  786. ptgAreaNR : "ptgAreaNR",
  787. ptgMemAreaNR : "ptgMemAreaNR",
  788. ptgMemNoMemNR : "ptgMemNoMemNR",
  789. ptgNameXR : "ptgNameXR",
  790. ptgRef3dR : "ptgRef3dR",
  791. ptgArea3dR : "ptgArea3dR",
  792. ptgRefErr3dR : "ptgRefErr3dR",
  793. ptgAreaErr3dR : "ptgAreaErr3dR",
  794. ptgArrayV : "ptgArrayV",
  795. ptgFuncV : "ptgFuncV",
  796. ptgFuncVarV : "ptgFuncVarV",
  797. ptgNameV : "ptgNameV",
  798. ptgRefV : "ptgRefV",
  799. ptgAreaV : "ptgAreaV",
  800. ptgMemAreaV : "ptgMemAreaV",
  801. ptgMemErrV : "ptgMemErrV",
  802. ptgMemNoMemV : "ptgMemNoMemV",
  803. ptgMemFuncV : "ptgMemFuncV",
  804. ptgRefErrV : "ptgRefErrV",
  805. ptgAreaErrV : "ptgAreaErrV",
  806. ptgRefNV : "ptgRefNV",
  807. ptgAreaNV : "ptgAreaNV",
  808. ptgMemAreaNV : "ptgMemAreaNV",
  809. ptgMemNoMemNV : "ptgMemNoMemNV",
  810. ptgFuncCEV : "ptgFuncCEV",
  811. ptgNameXV : "ptgNameXV",
  812. ptgRef3dV : "ptgRef3dV",
  813. ptgArea3dV : "ptgArea3dV",
  814. ptgRefErr3dV : "ptgRefErr3dV",
  815. ptgAreaErr3dV : "ptgAreaErr3dV",
  816. ptgArrayA : "ptgArrayA",
  817. ptgFuncA : "ptgFuncA",
  818. ptgFuncVarA : "ptgFuncVarA",
  819. ptgNameA : "ptgNameA",
  820. ptgRefA : "ptgRefA",
  821. ptgAreaA : "ptgAreaA",
  822. ptgMemAreaA : "ptgMemAreaA",
  823. ptgMemErrA : "ptgMemErrA",
  824. ptgMemNoMemA : "ptgMemNoMemA",
  825. ptgMemFuncA : "ptgMemFuncA",
  826. ptgRefErrA : "ptgRefErrA",
  827. ptgAreaErrA : "ptgAreaErrA",
  828. ptgRefNA : "ptgRefNA",
  829. ptgAreaNA : "ptgAreaNA",
  830. ptgMemAreaNA : "ptgMemAreaNA",
  831. ptgMemNoMemNA : "ptgMemNoMemNA",
  832. ptgFuncCEA : "ptgFuncCEA",
  833. ptgNameXA : "ptgNameXA",
  834. ptgRef3dA : "ptgRef3dA",
  835. ptgArea3dA : "ptgArea3dA",
  836. ptgRefErr3dA : "ptgRefErr3dA",
  837. ptgAreaErr3dA : "ptgAreaErr3dA"
  838. }
  839. error_msg_by_code = {
  840. 0x00: u"#NULL!", # intersection of two cell ranges is empty
  841. 0x07: u"#DIV/0!", # division by zero
  842. 0x0F: u"#VALUE!", # wrong type of operand
  843. 0x17: u"#REF!", # illegal or deleted cell reference
  844. 0x1D: u"#NAME?", # wrong function or range name
  845. 0x24: u"#NUM!", # value range overflow
  846. 0x2A: u"#N/A" # argument or function not available
  847. }