Malicious Office (OLE) — malware analysis report

Static analysis result for SHA-256 c83ab065955a8887…

MALICIOUS

Office (OLE)

524.5 KB Created: 1996-06-26 20:49:32 Authoring application: Microsoft Excel First seen: 2017-04-07
MD5: 4c52e2e9c3803757eb671fc0c361aba2 SHA-1: 4480879876b0040edcc3cd7a7d49a4a78d3f9ed0 SHA-256: c83ab065955a88873db70306160ee9cb8e4654b475076a872f7a6726157b07ca
98 Risk Score

Malware Insights

MITRE ATT&CK
T1059.005 Visual Basic

The file is an Excel document containing both VBA macros and Excel 4.0 (XLM) macros, with the XLM macros being obfuscated. The presence of Auto_Open and Auto_Close macros suggests an attempt to automatically execute code upon opening or closing the document. While the specific payload is not directly visible, the structure and heuristic firings indicate a downloader or dropper functionality, likely aiming to fetch and execute additional malicious content from external sources.

Heuristics 6

  • Obfuscated XLM defined-name macro chain high OLE_XLM_OBFUSCATED_DEFINED_NAME_CHAIN
    Excel 4.0 macro sheet uses many random-looking defined-name references, state-changing formulas, and control-transfer formulas while carrying embedded OOXML ZIP content in the workbook stream. This is a malicious XLM macro pattern rather than a document-parser CVE.
  • Excel 4.0 (XLM) macro sheet present medium OLE_XLM_AUTOOPEN
    Workbook contains an Excel 4.0 macro sheet sub-stream — XLM is rarely seen in modern legitimate workbooks and was a major Office malware vector during 2020-2022.
  • VBA macros detected medium 2 related findings OLE_VBA_MACROS
    Document contains VBA macro code
  • Auto_Open macro low OLE_VBA_AUTO
    Auto_Open macro
    Matched line in script
    Sub stub()
       Auto_open
       Main
  • Auto_Close macro low OLE_VBA_AUTOCLOSE
    Auto_Close macro
    Matched line in script
    Public Sub Auto_close()
        Application.ScreenUpdating = False
  • Embedded URL info EMBEDDED_URL
    One or more URLs were extracted from the document. The URL itself is not a detection — see the per-URL labels for which channel (macro, JS, link annotation, document body, ...) reached each URL.
    URL http://ocsp.verisign.com0 In document text (OLE body)
    • http://www.microsoft.com0In document text (OLE body)
    • http://crl.verisign.com/ThawteTimestampingCA.crl0In document text (OLE body)
    • http://crl.verisign.com/tss-ca.crl0In document text (OLE body)
    • http://crl.microsoft.com/pki/crl/products/CodeSignPCA.crl0In document text (OLE body)

Extracted artifacts 2

Files carved from inside the sample during analysis.

FilenameKindSourceSize
xlm_macros.txt xlm-macro oletools.olevba.extract_all_macros (XLM macro listing) 51205 bytes
SHA-256: 32db3b9c9d198a3704346ba9094dad4a8d27e5e31392f4547d31279462dddb90
Preview script
First 1,000 lines of the extracted script
' 0085     16 BOUNDSHEET : Sheet Information - worksheet or dialog sheet, visible -  Languag
' 0085     23 BOUNDSHEET : Sheet Information - worksheet or dialog sheet, visible -  Scenario_dialo
' 0085     19 BOUNDSHEET : Sheet Information - worksheet or dialog sheet, visible -  Save_dialo
' 0085     22 BOUNDSHEET : Sheet Information - worksheet or dialog sheet, visible -  Options_dialo
' 0085     18 BOUNDSHEET : Sheet Information - worksheet or dialog sheet, visible -  Add_dialo
' 0085     19 BOUNDSHEET : Sheet Information - worksheet or dialog sheet, visible -  Show_dialo
' 0085     21 BOUNDSHEET : Sheet Information - worksheet or dialog sheet, visible -  Finish_dialo
' 0085     23 BOUNDSHEET : Sheet Information - Excel 4.0 macro sheet, visible -  Excel4Function
' 0085     21 BOUNDSHEET : Sheet Information - worksheet or dialog sheet, visible -  Solver_dialo
' 0085     21 BOUNDSHEET : Sheet Information - Visual Basic module, visible -  VBA_Function
' 0018    255 LABEL : Cell Value, String Constant - __Command len=8 ptgArrayA  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x00\xf0;\xe7\x01'
' 0018    255 LABEL : Cell Value, String Constant - __Command len=8 ptgArrayA  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x00\x98<\xe7\x01'
' 0018    255 LABEL : Cell Value, String Constant - __Command len=8 ptgArrayA  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x00@=\xe7\x01'
' 0018    255 LABEL : Cell Value, String Constant - __Command len=8 ptgArrayA  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x00\xe8=\xe7\x01'
' 0018    255 LABEL : Cell Value, String Constant - __Command len=8 ptgArrayA  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x00\x90>\xe7\x01'
' 0018    255 LABEL : Cell Value, String Constant - __Command len=8 ptgArrayA  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x008?\xe7\x01'
' 0018    255 LABEL : Cell Value, String Constant - __Command len=8 ptgArrayA  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x008-\xe7\x01'
' 0018     29 LABEL : Cell Value, String Constant - __DemandLoad len=2 ptgBool TRUE 
' 0018     29 LABEL : Cell Value, String Constant - add_for len=7 ptgRef3d  VBA_Function!A88 
' 0018     33 LABEL : Cell Value, String Constant - add_formula len=7 ptgRef3d  VBA_Function!A89 
' 0018     29 LABEL : Cell Value, String Constant - add_ref len=7 ptgRef3d  VBA_Function!A87 
' 0018     29 LABEL : Cell Value, String Constant - addarg1 len=7 ptgRef3d  Scenario_dialo!A199 
' 0018     29 LABEL : Cell Value, String Constant - addarg2 len=7 ptgRef3d  Scenario_dialo!A200 
' 0018     29 LABEL : Cell Value, String Constant - addarg3 len=7 ptgRef3d  Scenario_dialo!A201 
' 0018     29 LABEL : Cell Value, String Constant - Addfunc len=7 ptgRef3d  Scenario_dialo!A191 
' 0018     31 LABEL : Cell Value, String Constant - Addin_Bar len=7 ptgRef3d  Scenario_dialo!B2 
' 0018     35 LABEL : Cell Value, String Constant - Addin_Command len=7 ptgRef3d  Scenario_dialo!C2 
' 0018     26 LABEL : Cell Value, String Constant - Adjustables len=0 
' 0018     26 LABEL : Cell Value, String Constant - anscount len=3 ptgInt 6 
' 0018     29 LABEL : Cell Value, String Constant - BarOpen len=7 ptgRef3d  Scenario_dialo!S32 
' 0018     32 LABEL : Cell Value, String Constant - change_for len=7 ptgRef3d  VBA_Function!A96 
' 0018     36 LABEL : Cell Value, String Constant - change_formula len=7 ptgRef3d  VBA_Function!A97 
' 0018     32 LABEL : Cell Value, String Constant - change_ref len=7 ptgRef3d  VBA_Function!A95 
' 0018     29 LABEL : Cell Value, String Constant - Cleanup len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x06\x00\x0f\x0f\x0f\x00'
' 0018     29 LABEL : Cell Value, String Constant - Cleanup len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x08\x00\x0f\x0f\x0f\x00'
' 0018     29 LABEL : Cell Value, String Constant - Cleanup len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x05\x00\x0f\x0f\x0f\x00'
' 0018     29 LABEL : Cell Value, String Constant - Cleanup len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x04\x00\x0f\x0f\x0f\x00'
' 0018     29 LABEL : Cell Value, String Constant - Cleanup len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x02\x00\x0f\x0f\x0f\x00'
' 0018     29 LABEL : Cell Value, String Constant - Cleanup len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x0f\x0f\x0f\x00'
' 0018     29 LABEL : Cell Value, String Constant - Cleanup len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\t\x00\x00\x00\t\x00'
' 0018     33 LABEL : Cell Value, String Constant - CommandName len=7 ptgRef3d  Scenario_dialo!B1 
' 0018     29 LABEL : Cell Value, String Constant - Constraint_Add len=0 
' 0018     30 LABEL : Cell Value, String Constant - Constraint_help len=0 
' 0018     28 LABEL : Cell Value, String Constant - Constraint_OK len=0 
' 0018     30 LABEL : Cell Value, String Constant - Constraint_sign len=0 
' 0018     26 LABEL : Cell Value, String Constant - Cont_button len=0 
' 0018     29 LABEL : Cell Value, String Constant - del_for len=7 ptgRef3d  VBA_Function!A104 
' 0018     33 LABEL : Cell Value, String Constant - del_formula len=7 ptgRef3d  VBA_Function!A105 
' 0018     29 LABEL : Cell Value, String Constant - del_ref len=7 ptgRef3d  VBA_Function!A103 
' 0018     29 LABEL : Cell Value, String Constant - Delfunc len=7 ptgRef3d  Scenario_dialo!A192 
' 0018     30 LABEL : Cell Value, String Constant - dShowref len=7 ptgRef3d 11!B1 
' 0018     33 LABEL : Cell Value, String Constant - Enginecount len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x06\x00\x12\x12\x12\x00'
' 0018     33 LABEL : Cell Value, String Constant - Enginecount len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x08\x00\x12\x12\x12\x00'
' 0018     33 LABEL : Cell Value, String Constant - Enginecount len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x05\x00\x12\x12\x12\x00'
' 0018     33 LABEL : Cell Value, String Constant - Enginecount len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x04\x00\x12\x12\x12\x00'
' 0018     33 LABEL : Cell Value, String Constant - Enginecount len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x02\x00\x12\x12\x12\x00'
' 0018     33 LABEL : Cell Value, String Constant - Enginecount len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x12\x12\x12\x00'
' 0018     33 LABEL : Cell Value, String Constant - Enginecount len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\t\x00\x00\x00\t\x00'
' 0018     34 LABEL : Cell Value, String Constant - Engineresult len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x06\x00\x13\x13\x13\x00'
' 0018     34 LABEL : Cell Value, String Constant - Engineresult len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x08\x00\x13\x13\x13\x00'
' 0018     34 LABEL : Cell Value, String Constant - Engineresult len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x05\x00\x13\x13\x13\x00'
' 0018     34 LABEL : Cell Value, String Constant - Engineresult len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x04\x00\x13\x13\x13\x00'
' 0018     34 LABEL : Cell Value, String Constant - Engineresult len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x02\x00\x13\x13\x13\x00'
' 0018     34 LABEL : Cell Value, String Constant - Engineresult len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x07\x00\x13\x13\x13\x00'
' 0018     34 LABEL : Cell Value, String Constant - Engineresult len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\t\x00\x00\x00\t\x00'
' 0018     28 LABEL : Cell Value, String Constant - Finish_cancel len=0 
' 0018     26 LABEL : Cell Value, String Constant - Finish_help len=0 
' 0018     24 LABEL : Cell Value, String Constant - Finish_ok len=0 
' 0018     28 LABEL : Cell Value, String Constant - GetDef len=7 ptgRef3d  VBA_Function!A13 
' 0018     30 LABEL : Cell Value, String Constant - load_arg len=7 ptgRef3d  VBA_Function!A81 
' 0018     24 LABEL : Cell Value, String Constant - Load_help len=0 
' 0018     30 LABEL : Cell Value, String Constant - loadarg1 len=7 ptgRef3d  Scenario_dialo!A202 
' 0018     30 LABEL : Cell Value, String Constant - Loadfunc len=7 ptgRef3d  Scenario_dialo!A193 
' 0018     24 LABEL : Cell Value, String Constant - Main_help len=0 
' 0018     30 LABEL : Cell Value, String Constant - Max_button_push len=0 
' 0018     32 LABEL : Cell Value, String Constant - MenuUpdate len=7 ptgRef3d 11!A26 
' 0018     32 LABEL : Cell Value, String Constant - MenuUpdate len=7 ptgRef3d  VBA_Function!A122 
' 0018     30 LABEL : Cell Value, String Constant - Min_button_push len=0 
' 0018     32 LABEL : Cell Value, String Constant - msg_branch len=7 ptgRef3d  Scenario_dialo!A173 
' 0018     32 LABEL : Cell Value, String Constant - msg_incumb len=7 ptgRef3d  Scenario_dialo!A174 
' 0018     33 LABEL : Cell Value, String Constant - msg_setcell len=7 ptgRef3d  Scenario_dialo!A175 
' 0018     31 LABEL : Cell Value, String Constant - msg_setup len=7 ptgRef3d  Scenario_dialo!A171 
' 0018     31 LABEL : Cell Value, String Constant - msg_trial len=7 ptgRef3d  Scenario_dialo!A172 
' 0018     30 LABEL : Cell Value, String Constant - Namecell len=7 ptgRef3d  VBA_Function!A10 
' 0018     18 LABEL : Cell Value, String Constant - Obj len=0 
' 0018     34 LABEL : Cell Value, String Constant - ok?_changing len=7 ptgRef3d  VBA_Function!A55 
' 0018     34 LABEL : Cell Value, String Constant - ok?_set_cell len=7 ptgRef3d  VBA_Function!A54 
' 0018     33 LABEL : Cell Value, String Constant - ok_changing len=7 ptgRef3d  VBA_Function!A47 
' 0018     33 LABEL : Cell Value, String Constant - ok_set_cell len=7 ptgRef3d  VBA_Function!A46 
' 0018     28 LABEL : Cell Value, String Constant - okarg1 len=7 ptgRef3d  Scenario_dialo!A203 
' 0018     28 LABEL : Cell Value, String Constant - okarg2 len=7 ptgRef3d  Scenario_dialo!A204 
' 0018     28 LABEL : Cell Value, String Constant - okarg3 len=7 ptgRef3d  Scenario_dialo!A205 
' 0018     28 LABEL : Cell Value, String Constant - okarg4 len=7 ptgRef3d  Scenario_dialo!A206 
' 0018     28 LABEL : Cell Value, String Constant - Okfunc len=7 ptgRef3d  Scenario_dialo!A194 
' 0018     29 LABEL : Cell Value, String Constant - optarg1 len=7 ptgRef3d  Scenario_dialo!A207 
' 0018     30 LABEL : Cell Value, String Constant - optarg10 len=7 ptgRef3d  Scenario_dialo!A216 
' 0018     30 LABEL : Cell Value, String Constant - optarg11 len=7 ptgRef3d  Scenario_dialo!A217 
' 0018     30 LABEL : Cell Value, String Constant - optarg12 len=7 ptgRef3d  Scenario_dialo!A218 
' 0018     29 LABEL : Cell Value, String Constant - optarg2 len=7 ptgRef3d  Scenario_dialo!A208 
' 0018     29 LABEL : Cell Value, String Constant - optarg3 len=7 ptgRef3d  Scenario_dialo!A209 
' 0018     29 LABEL : Cell Value, String Constant - optarg4 len=7 ptgRef3d  Scenario_dialo!A210 
' 0018     29 LABEL : Cell Value, String Constant - optarg5 len=7 ptgRef3d  Scenario_dialo!A211 
' 0018     29 LABEL : Cell Value, String Constant - optarg6 len=7 ptgRef3d  Scenario_dialo!A212 
' 0018     29 LABEL : Cell Value, String Constant - optarg7 len=7 ptgRef3d  Scenario_dialo!A213 
' 0018     29 LABEL : Cell Value, String Constant - optarg8 len=7 ptgRef3d  Scenario_dialo!A214 
' 0018     29 LABEL : Cell Value, String Constant - optarg9 len=7 ptgRef3d  Scenario_dialo!A215 
' 0018     28 LABEL : Cell Value, String Constant - Option_cancel len=0 
' 0018     26 LABEL : Cell Value, String Constant - Option_help len=0 
' 0018     24 LABEL : Cell Value, String Constant - Option_OK len=0 
' 0018     33 LABEL : Cell Value, String Constant - Optionsfunc len=7 ptgRef3d  Scenario_dialo!A195 
' 0018     23 LABEL : Cell Value, String Constant - Push_add len=0 
' 0018     26 LABEL : Cell Value, String Constant - Push_change len=0 
' 0018     25 LABEL : Cell Value, String Constant - Push_close len=0 
' 0018     26 LABEL : Cell Value, String Constant - Push_delete len=0 
' 0018     25 LABEL : Cell Value, String Constant - Push_guess len=0 
' 0018     24 LABEL : Cell Value, String Constant - Push_load len=0 
' 0018     27 LABEL : Cell Value, String Constant - Push_options len=0 
' 0018     25 LABEL : Cell Value, String Constant - Push_reset len=0 
' 0018     24 LABEL : Cell Value, String Constant - Push_save len=0 
' 0018     28 LABEL : Cell Value, String Constant - Push_scenario len=0 
' 0018     31 LABEL : Cell Value, String Constant - Resetfunc len=7 ptgRef3d  Scenario_dialo!A196 
' 0018     30 LABEL : Cell Value, String Constant - save_arg len=7 ptgRef3d  VBA_Function!A77 
' 0018     30 LABEL : Cell Value, String Constant - savearg1 len=7 ptgRef3d  Scenario_dialo!A219 
' 0018     30 LABEL : Cell Value, String Constant - Savefunc len=7 ptgRef3d  Scenario_dialo!A197 
' 0018     23 LABEL : Cell Value, String Constant - SaveLoad len=0 
' 0018     28 LABEL : Cell Value, String Constant - Scenario_help len=0 
' 0018     26 LABEL : Cell Value, String Constant - Scenario_OK len=0 
' 0018     26 LABEL : Cell Value, String Constant - Show len=7 ptgRef3d 11!A16 
' 0018     26 LABEL : Cell Value, String Constant - Show len=7 ptgRef3d  VBA_Function!A16 
' 0018     24 LABEL : Cell Value, String Constant - show_case len=0 
' 0018     30 LABEL : Cell Value, String Constant - Showform len=7 ptgRef3d 11!A22 
' 0018     23 LABEL : Cell Value, String Constant - ShowForm len=0 
' 0018     21 LABEL : Cell Value, String Constant - Showme len=0 
' 0018     33 LABEL : Cell Value, String Constant - showmsg len=11 ptgArea3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x01\x00\xb0\x00\xb2\x00\x00\x00\x00\x00'
' 0018     28 LABEL : Cell Value, String Constant - Solve_problem len=0 
' 0018     31 LABEL : Cell Value, String Constant - SolveCall len=7 ptgRef3d 11!A1 
' 0018     30 LABEL : Cell Value, String Constant - SolveDLL len=7 ptgRef3d 11!A13 
' 0018     31 LABEL : Cell Value, String Constant - Solvefunc len=7 ptgRef3d  Scenario_dialo!A198 
' 0018     84 LABEL : Cell Value, String Constant - SOLVER.ADD len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00S\x00\x00\x00'
' 0018    100 LABEL : Cell Value, String Constant - SOLVER.CHANGE len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00[\x00\x00\x00'
' 0018    102 LABEL : Cell Value, String Constant - SOLVER.DELETE len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00c\x00\x00\x00'
' 0018     34 LABEL : Cell Value, String Constant - SOLVER.DODAJ len=7 ptgRef3d  VBA_Function!A84 
' 0018    141 LABEL : Cell Value, String Constant - SOLVER.FINISH len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00k\x00\x00\x00'
' 0018    116 LABEL : Cell Value, String Constant - SOLVER.FINISH? len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00o\x00\x00\x00'
' 0018     91 LABEL : Cell Value, String Constant - SOLVER.GET len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00s\x00\x00\x00'
' 0018    117 LABEL : Cell Value, String Constant - SOLVER.LOAD len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00O\x00\x00\x00'
' 0018     34 LABEL : Cell Value, String Constant - SOLVER.MODEL len=7 ptgRef3d  VBA_Function!A116 
' 0018     31 LABEL : Cell Value, String Constant - SOLVER.OK len=7 ptgRef3d  VBA_Function!A42 
' 0018     32 LABEL : Cell Value, String Constant - SOLVER.OK? len=7 ptgRef3d  VBA_Function!A50 
' 0018     34 LABEL : Cell Value, String Constant - SOLVER.OPCJE len=7 ptgRef3d  VBA_Function!A58 
' 0018     90 LABEL : Cell Value, String Constant - SOLVER.OPTIONS len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x009\x00\x00\x00'
' 0018     52 LABEL : Cell Value, String Constant -  S O L V E R .  len=7 *UNKNOWN TOKEN* 0x0050 *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00R\x00Z\x00Y'
' 0018     98 LABEL : Cell Value, String Constant - SOLVER.RESET len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00w\x00\x00\x00'
' 0018     50 LABEL : Cell Value, String Constant -  S O L V E R . len=7 *UNKNOWN TOKEN* 0x0000 *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'R\x00O\x00Z\x00'
' 0018    102 LABEL : Cell Value, String Constant - SOLVER.SAVE len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00K\x00\x00\x00'
' 0018     74 LABEL : Cell Value, String Constant - SOLVER.SOLVE len=7 ptgRefErr3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00\x00G\x00\x00\x00'
' 0018     44 LABEL : Cell Value, String Constant -  S O L V E  len=7 *UNKNOWN TOKEN* 0x0052 *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x00.\x00U\x00S'
' 0018     50 LABEL : Cell Value, String Constant -  S O L V E R . len=7 *UNKNOWN TOKEN* 0x0000 *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'Z\x00A\x00K\x00'
' 0018     52 LABEL : Cell Value, String Constant -  S O L V E R .  len=7 ptgRef3dV 16640!ÔS19201 
' 0018     50 LABEL : Cell Value, String Constant -  S O L V E R . len=7 *UNKNOWN TOKEN* 0x0000 *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'Z\x00A\x00A\x01'
' 0018     35 LABEL : Cell Value, String Constant - SOLVER.ZAPISZ len=7 ptgRef3d  VBA_Function!A76 
' 0018     46 LABEL : Cell Value, String Constant -  S O L V E R len=7 *UNKNOWN TOKEN* 0x0000 *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'.\x00Z\x00M\x00'
' 0018     32 LABEL : Cell Value, String Constant - solver_bin len=7 ptgRef3d  Scenario_dialo!A189 
' 0018     36 LABEL : Cell Value, String Constant - Solver_err_msg len=7 ptgRef3d  Scenario_dialo!A181 
' 0018     36 LABEL : Cell Value, String Constant - solver_grg_eng len=7 ptgRef3d  Scenario_dialo!A42 
' 0018     32 LABEL : Cell Value, String Constant - solver_int len=7 ptgRef3d  Scenario_dialo!A188 
' 0018     35 LABEL : Cell Value, String Constant - solver_lp_eng len=7 ptgRef3d  Scenario_dialo!A43 
' 0018     35 LABEL : Cell Value, String Constant - solver_ls_eng len=7 ptgRef3d  Scenario_dialo!A45 
' 0018     34 LABEL : Cell Value, String Constant - Solver_msg_1 len=7 ptgRef3d  Scenario_dialo!A2 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_10 len=7 ptgRef3d  Scenario_dialo!A18 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_100 len=7 ptgRef3d  Scenario_dialo!A136 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_101 len=7 ptgRef3d  Scenario_dialo!A137 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_102 len=7 ptgRef3d  Scenario_dialo!A138 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_103 len=7 ptgRef3d  Scenario_dialo!A139 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_104 len=7 ptgRef3d  Scenario_dialo!A140 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_105 len=7 ptgRef3d  Scenario_dialo!A141 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_106 len=7 ptgRef3d  Scenario_dialo!A142 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_107 len=7 ptgRef3d  Scenario_dialo!A143 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_108 len=7 ptgRef3d  Scenario_dialo!A144 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_109 len=7 ptgRef3d  Scenario_dialo!A145 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_10a len=7 ptgRef3d  Scenario_dialo!A19 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_11 len=7 ptgRef3d  Scenario_dialo!A20 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_110 len=7 ptgRef3d  Scenario_dialo!A146 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_111 len=7 ptgRef3d  Scenario_dialo!A148 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_112 len=7 ptgRef3d  Scenario_dialo!A149 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_113 len=7 ptgRef3d  Scenario_dialo!A151 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_114 len=7 ptgRef3d  Scenario_dialo!A152 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_115 len=7 ptgRef3d  Scenario_dialo!A153 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_116 len=7 ptgRef3d  Scenario_dialo!A154 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_117 len=7 ptgRef3d  Scenario_dialo!A155 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_118 len=7 ptgRef3d  Scenario_dialo!A157 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_119 len=7 ptgRef3d  Scenario_dialo!A158 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_12 len=7 ptgRef3d  Scenario_dialo!A21 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_120 len=7 ptgRef3d  Scenario_dialo!A159 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_121 len=7 ptgRef3d  Scenario_dialo!A160 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_122 len=7 ptgRef3d  Scenario_dialo!A161 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_123 len=7 ptgRef3d  Scenario_dialo!A162 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_124 len=7 ptgRef3d  Scenario_dialo!A163 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_125 len=7 ptgRef3d  Scenario_dialo!A164 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_126 len=7 ptgRef3d  Scenario_dialo!A165 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_127 len=7 ptgRef3d  Scenario_dialo!A166 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_128 len=7 ptgRef3d  Scenario_dialo!A167 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_129 len=7 ptgRef3d  Scenario_dialo!A168 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_13 len=7 ptgRef3d  Scenario_dialo!A22 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_130 len=7 ptgRef3d  Scenario_dialo!A169 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_131 len=7 ptgRef3d  Scenario_dialo!A37 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_132 len=7 ptgRef3d  Scenario_dialo!A38 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_14 len=7 ptgRef3d  Scenario_dialo!A23 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_15 len=7 ptgRef3d  Scenario_dialo!A24 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_150 len=7 ptgRef3d  Scenario_dialo!A184 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_151 len=7 ptgRef3d  Scenario_dialo!A185 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_16 len=7 ptgRef3d  Scenario_dialo!A25 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_17 len=7 ptgRef3d  Scenario_dialo!A26 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_18 len=7 ptgRef3d  Scenario_dialo!A27 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_19 len=7 ptgRef3d  Scenario_dialo!A28 
' 0018     35 LABEL : Cell Value, String Constant - solver_msg_1a len=7 ptgRef3d  Scenario_dialo!A3 
' 0018     35 LABEL : Cell Value, String Constant - solver_msg_1b len=7 ptgRef3d  Scenario_dialo!A4 
' 0018     35 LABEL : Cell Value, String Constant - solver_msg_1c len=7 ptgRef3d  Scenario_dialo!A5 
' 0018     34 LABEL : Cell Value, String Constant - Solver_msg_2 len=7 ptgRef3d  Scenario_dialo!A6 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_20 len=7 ptgRef3d  Scenario_dialo!A29 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_21 len=7 ptgRef3d  Scenario_dialo!A30 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_22 len=7 ptgRef3d  Scenario_dialo!A31 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_23 len=7 ptgRef3d  Scenario_dialo!A32 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_24 len=7 ptgRef3d  Scenario_dialo!A33 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_24a len=7 ptgRef3d  Scenario_dialo!A35 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_24b len=7 ptgRef3d  Scenario_dialo!A36 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_25 len=7 ptgRef3d  Scenario_dialo!A34 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_25a len=7 ptgRef3d  Scenario_dialo!A39 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_25b len=7 ptgRef3d  Scenario_dialo!A40 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_26 len=7 ptgRef3d  Scenario_dialo!A47 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_27 len=7 ptgRef3d  Scenario_dialo!A48 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_28 len=7 ptgRef3d  Scenario_dialo!A49 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_29 len=7 ptgRef3d  Scenario_dialo!A51 
' 0018     36 LABEL : Cell Value, String Constant - Solver_msg_29a len=7 ptgRef3d  Scenario_dialo!A52 
' 0018     34 LABEL : Cell Value, String Constant - Solver_msg_3 len=7 ptgRef3d  Scenario_dialo!A7 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_30 len=7 ptgRef3d  Scenario_dialo!A53 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_31 len=7 ptgRef3d  Scenario_dialo!A54 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_32 len=7 ptgRef3d  Scenario_dialo!A55 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_33 len=7 ptgRef3d  Scenario_dialo!A56 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_34 len=7 ptgRef3d  Scenario_dialo!A57 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_35 len=7 ptgRef3d  Scenario_dialo!A58 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_36 len=7 ptgRef3d  Scenario_dialo!A59 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_37 len=7 ptgRef3d  Scenario_dialo!A60 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_38 len=7 ptgRef3d  Scenario_dialo!A61 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_39 len=7 ptgRef3d  Scenario_dialo!A62 
' 0018     35 LABEL : Cell Value, String Constant - solver_msg_3a len=7 ptgRef3d  Scenario_dialo!A8 
' 0018     34 LABEL : Cell Value, String Constant - Solver_msg_4 len=7 ptgRef3d  Scenario_dialo!A9 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_40 len=7 ptgRef3d  Scenario_dialo!A63 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_41 len=7 ptgRef3d  Scenario_dialo!A64 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_42 len=7 ptgRef3d  Scenario_dialo!A65 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_43 len=7 ptgRef3d  Scenario_dialo!A66 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_44 len=7 ptgRef3d  Scenario_dialo!A67 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_45 len=7 ptgRef3d  Scenario_dialo!A70 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_46 len=7 ptgRef3d  Scenario_dialo!A71 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_46a len=7 ptgRef3d  Scenario_dialo!A73 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_46b len=7 ptgRef3d  Scenario_dialo!A74 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_47 len=7 ptgRef3d  Scenario_dialo!A76 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_48 len=7 ptgRef3d  Scenario_dialo!A78 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_49 len=7 ptgRef3d  Scenario_dialo!A79 
' 0018     34 LABEL : Cell Value, String Constant - Solver_msg_5 len=7 ptgRef3d  Scenario_dialo!A10 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_50 len=7 ptgRef3d  Scenario_dialo!A80 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_51 len=7 ptgRef3d  Scenario_dialo!A81 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_52 len=7 ptgRef3d  Scenario_dialo!A82 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_53 len=7 ptgRef3d  Scenario_dialo!A84 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_54 len=7 ptgRef3d  Scenario_dialo!A85 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_55 len=7 ptgRef3d  Scenario_dialo!A86 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_56 len=7 ptgRef3d  Scenario_dialo!A87 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_57 len=7 ptgRef3d  Scenario_dialo!A88 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_58 len=7 ptgRef3d  Scenario_dialo!A89 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_59 len=7 ptgRef3d  Scenario_dialo!A90 
' 0018     34 LABEL : Cell Value, String Constant - Solver_msg_6 len=7 ptgRef3d  Scenario_dialo!A11 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_60 len=7 ptgRef3d  Scenario_dialo!A91 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_61 len=7 ptgRef3d  Scenario_dialo!A92 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_62 len=7 ptgRef3d  Scenario_dialo!A94 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_63 len=7 ptgRef3d  Scenario_dialo!A95 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_64 len=7 ptgRef3d  Scenario_dialo!A96 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_65 len=7 ptgRef3d  Scenario_dialo!A97 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_66 len=7 ptgRef3d  Scenario_dialo!A98 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_67 len=7 ptgRef3d  Scenario_dialo!A100 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_68 len=7 ptgRef3d  Scenario_dialo!A101 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_69 len=7 ptgRef3d  Scenario_dialo!A102 
' 0018     35 LABEL : Cell Value, String Constant - solver_msg_6b len=7 ptgRef3d  Scenario_dialo!A12 
' 0018     35 LABEL : Cell Value, String Constant - solver_msg_6c len=7 ptgRef3d  Scenario_dialo!A13 
' 0018     34 LABEL : Cell Value, String Constant - Solver_msg_7 len=7 ptgRef3d  Scenario_dialo!A15 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_70 len=7 ptgRef3d  Scenario_dialo!A103 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_71 len=7 ptgRef3d  Scenario_dialo!A104 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_72 len=7 ptgRef3d  Scenario_dialo!A105 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_73 len=7 ptgRef3d  Scenario_dialo!A106 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_74 len=7 ptgRef3d  Scenario_dialo!A107 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_75 len=7 ptgRef3d  Scenario_dialo!A108 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_76 len=7 ptgRef3d  Scenario_dialo!A109 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_77 len=7 ptgRef3d  Scenario_dialo!A111 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_78 len=7 ptgRef3d  Scenario_dialo!A112 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_79 len=7 ptgRef3d  Scenario_dialo!A113 
' 0018     35 LABEL : Cell Value, String Constant - solver_msg_7a len=7 ptgRef3d  Scenario_dialo!A14 
' 0018     34 LABEL : Cell Value, String Constant - Solver_msg_8 len=7 ptgRef3d  Scenario_dialo!A16 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_80 len=7 ptgRef3d  Scenario_dialo!A115 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_81 len=7 ptgRef3d  Scenario_dialo!A116 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_82 len=7 ptgRef3d  Scenario_dialo!A117 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_83 len=7 ptgRef3d  Scenario_dialo!A118 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_84 len=7 ptgRef3d  Scenario_dialo!A119 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_85 len=7 ptgRef3d  Scenario_dialo!A120 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_86 len=7 ptgRef3d  Scenario_dialo!A121 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_87 len=7 ptgRef3d  Scenario_dialo!A122 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_88 len=7 ptgRef3d  Scenario_dialo!A123 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_89 len=7 ptgRef3d  Scenario_dialo!A124 
' 0018     34 LABEL : Cell Value, String Constant - Solver_msg_9 len=7 ptgRef3d  Scenario_dialo!A17 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_90 len=7 ptgRef3d  Scenario_dialo!A125 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_91 len=7 ptgRef3d  Scenario_dialo!A126 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_92 len=7 ptgRef3d  Scenario_dialo!A127 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_93 len=7 ptgRef3d  Scenario_dialo!A128 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_94 len=7 ptgRef3d  Scenario_dialo!A129 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_95 len=7 ptgRef3d  Scenario_dialo!A131 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_96 len=7 ptgRef3d  Scenario_dialo!A132 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_97 len=7 ptgRef3d  Scenario_dialo!A133 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_98 len=7 ptgRef3d  Scenario_dialo!A134 
' 0018     35 LABEL : Cell Value, String Constant - Solver_msg_99 len=7 ptgRef3d  Scenario_dialo!A135 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_bin len=7 ptgRef3d  Scenario_dialo!A187 
' 0018     36 LABEL : Cell Value, String Constant - solver_msg_int len=7 ptgRef3d  Scenario_dialo!A186 
' 0018     35 LABEL : Cell Value, String Constant - solver_msg_se len=7 ptgRef3d  Scenario_dialo!A69 
' 0018     28 LABEL : Cell Value, String Constant - solver_opt len=3 ptgInt 3 
' 0018     35 LABEL : Cell Value, String Constant - solver_qp_eng len=7 ptgRef3d  Scenario_dialo!A44 
' 0018     36 LABEL : Cell Value, String Constant - solver_reason1 len=7 ptgRef3d  Scenario_dialo!A177 
' 0018     36 LABEL : Cell Value, String Constant - solver_reason2 len=7 ptgRef3d  Scenario_dialo!A178 
' 0018     36 LABEL : Cell Value, String Constant - solver_reason3 len=7 ptgRef3d  Scenario_dialo!A179 
' 0018     34 LABEL : Cell Value, String Constant - solver_table len=7 ptgRef3d 11!B25 
' 0018     34 LABEL : Cell Value, String Constant - solver_table len=7 ptgRef3d  VBA_Function!B26 
' 0018     32 LABEL : Cell Value, String Constant - solver_tbl len=7 ptgRef3d 11!B25 
' 0018     32 LABEL : Cell Value, String Constant - solver_tbl len=7 ptgRef3d  VBA_Function!B26 
' 0018     36 LABEL : Cell Value, String Constant - SolverMenu len=11 ptgArea3d  *INCOMPLETE FORMULA PARSING* Remaining, unparsed expression: b'\x01\x00\xb6\x00\xb6\x00\x00\x00\x04\x00'
' 0018     35 LABEL : Cell Value, String Constant - SolverMenubar len=7 ptgRef3d  Scenario_dialo!A221 
' 0018     36 LABEL : Cell Value, String Constant - SolverMenuitem len=7 ptgRef3d  Scenario_dialo!A183 
' 0018     26 LABEL : Cell Value, String Constant - Stop_button len=0 
' 0018     24 LABEL : Cell Value, String Constant - Stop_help len=0 
' 0018     29 LABEL : Cell Value, String Constant - TheCall len=7 ptgRef3d 11!A3 
' 0018     29 LABEL : Cell Value, String Constant - TheCall len=7 ptgRef3d  VBA_Function!A3 
' 0018     29 LABEL : Cell Value, String Constant - TheMenu len=7 ptgRef3d 11!A25 
' 0018     28 LABEL : Cell Value, String Constant - unregi len=7 ptgRef3d 11!A10 
' 0018     28 LABEL : Cell Value, String Constant - unregi len=7 ptgRef3d  VBA_Function!A133 
' 0018     32 LABEL : Cell Value, String Constant - Value_button_push len=0 
' 002a      2 PRINTHEADERS : Print Row/Column Labels
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 002a      2 PRINTHEADERS : Print Row/Column Labels
' 002a      2 PRINTHEADERS : Print Row/Column Labels
' 002a      2 PRINTHEADERS : Print Row/Column Labels
' 002a      2 PRINTHEADERS : Print Row/Column Labels
' 002a      2 PRINTHEADERS : Print Row/Column Labels
' 002a      2 PRINTHEADERS : Print Row/Column Labels
' 002a      2 PRINTHEADERS : Print Row/Column Labels
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 00fd     10 LABELSST : Cell Value, String Constant/ SST
' 002a      2 PRINTHEADERS : Print Row/Column Labels
' Sheet,Reference,Formula,Value
'  Excel4Function,A2,ERROR(FALSE),""
'  Excel4Function,A3,[],""
'  Excel4Function,A4,ERROR(TRUE),""
'  Excel4Function,A5,[],""
'  Excel4Function,A6,"SET.VALUE(TheCall,9)",""
'  Excel4Function,A7,*STACKERROR* not enough arguments for function: END.IF,""
'  Excel4Function,A8,RETURN(TheCall),""
'  Excel4Function,A10,[],""
'  Excel4Function,A11,RETURN(),""
'  Excel4Function,A13,"REGISTER(GET.DOCUMENT(2,GET.CELL(32,A1))&IF(LEFT(GET.WORKSPACE(1),1)="M",":Solver Add-In","\SOLVER32"),"Solve","IE")",""
'  Excel4Function,A14,RETURN(),""
'  Excel4Function,A16,"ARGUMENT("show_case",1)",""
'  Excel4Function,A17,[],""
'  Excel4Function,A18,"=",""
'  Excel4Function,A19,*STACKERROR* not enough arguments for function: ELSE,""
'  Excel4Function,A20,"=ShowMe(",""
'  Excel4Function,A21,*STACKERROR* not enough arguments for function: END.IF,""
'  Excel4Function,A22,Showme(1),""
'  Excel4Function,A23,RETURN(Showform),""
'  Excel4Function,A26,10,""
'  Excel4Function,A27,[],""
'  Excel4Function,A28,10,""
'  Excel4Function,A29,"ADD.COMMAND(10,SolverMenubar,SolverMenu,MenuUpdate)",""
'  Excel4Function,A30,*STACKERROR* not enough arguments for function: ELSE,""
'  Excel4Function,A31,"ADD.COMMAND(10,SolverMenubar,SolverMenu,"---")",""
'  Excel4Function,A32,*STACKERROR* not enough arguments for function: END.IF,""
'  Excel4Function,A33,RETURN(),""
macros.bas vba-macro oletools.olevba.extract_macros (decoded VBA source) 208893 bytes
SHA-256: 3d15203bdce8d8a2e4ed42ad9d6655e3a574c61a47bafb9ef20a6050fe39347c
Preview script
First 1,000 lines of the extracted script
Attribute VB_Name = "Sheet1"
Attribute VB_Base = "0{00020820-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "ThisWorkbook"
Attribute VB_Base = "0{00020819-0000-0000-C000-000000000046}"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = True
Attribute VB_TemplateDerived = False
Attribute VB_Customizable = True

Attribute VB_Name = "Solver1"
Option Explicit

Public answer, action As String, change As Boolean, fresh As Boolean
Public oldobj, oldobjformat As String, dllavail As Boolean
Public solver_adj As String, solver_opt As String, solver_lin As Integer, solver_neg As Integer
Public solver_typ As Integer, solver_rep As Integer, solver_sho As Integer
Public solver_scl As Integer, solver_est As Integer, solver_nwt As Integer, solver_drv As Integer
Public report_generation As Boolean, stop_solver As Boolean, remembersheet As String
Public currentarea, solver_num As Integer
Public oldvars() As Double, oldvarformats() As String
Public AutoOpened As Boolean, savestyle
Public excel4language, excel4sheet, helpfile As String


Sub stub()
   Auto_open
   Main
End Sub

Public Static Sub Main()
    ' This is the main routine, displaying the Solver dialog box, and taking appropiate
    ' action, depending on what the user does.
    Dim savecalculation As Integer, savestatusbar As Boolean, savescreenupdate As Boolean
    Dim dummy As String, i As Integer, c, vbacode As String, thearray
    Dim newpart As String, dummy2 As Integer
    SolverName
    On Error GoTo errorhandling
    If ActiveSheet.Type <> xlWorksheet Or ActiveSheet.ProtectContents Then
        MsgBox excel4language.Range("solver_msg_1").Text, 32, , helpfile, 1830
        End
    End If
    If ActiveWorkbook.IsInplace = True Then
        MsgBox excel4language.Range("solver_msg_1c").Text, 32, , helpfile, 1830
        End
    End If
    If Left(Application.OperatingSystem, 1) = "W" Then
      ' Edwin 10/3/00
      ' If Application.Version > CStr(6) Then
          If ActiveWorkbook.MultiUserEditing Then
             MsgBox excel4language.Range("solver_msg_1").Text, 32, , helpfile, 1830
             End
          End If
      ' End If
    End If
    If ActiveWindow.SelectedSheets.Count > 1 Then
        MsgBox excel4language.Range("solver_msg_1b").Text, 32, , helpfile, 1830
        End
    End If
    thearray = Application.RegisteredFunctions
    If IsNull(thearray) Then
        MsgBox excel4language.Range("solver_msg_1a").Text, 32, , helpfile, 1830
    Else
       dllavail = False
       For i = LBound(thearray) To UBound(thearray)
          If Left(Application.OperatingSystem, 1) = "W" Then
             If Right(thearray(i, 1), 12) = "SOLVER32.DLL" Then
                dllavail = True
                Exit For
             End If
          Else
             If Right(thearray(i, 1), 13) = "Solver Add-In" Then
                dllavail = True
                Exit For
             End If
          End If
       Next
       If Not dllavail Then
          MsgBox excel4language.Range("solver_msg_1a").Text, 32, , helpfile, 1830
       End If
    End If
    On Error GoTo mainerror
    savestatusbar = Application.DisplayStatusBar
    Application.DisplayStatusBar = True
    savescreenupdate = Application.ScreenUpdating
    Application.EnableCancelKey = xlDisabled
    savestyle = Application.ReferenceStyle
    On Error GoTo selectionerror
    currentarea = Selection.Address(ReferenceStyle:=savestyle)
    On Error GoTo mainerror
    fresh = False
    On Error GoTo freshhandle
    dummy = ActiveSheet.Names("solver_typ")
    On Error GoTo mainerror
    Application.ScreenUpdating = False
    solver_typ = 1
    If fresh Then
       Set_defaults
    Else
       Get_settings
    End If
    action = ""
    Application.RecordMacro basiccode:=""
    While action <> "Cancel"
      Application.ScreenUpdating = True
      action = "Cancel"
      On Error Resume Next
      ThisWorkbook.DialogSheets("Solver_dialog").Show
      On Error GoTo mainerror
      If action <> "Cancel" And action <> "" Then
         Define_names
         solver_adj = ""
         On Error Resume Next
         solver_adj = Range(ActiveSheet.Names("solver_adj").Name).Address
         newpart = ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("dValueof").Caption
         If "." <> Application.International(xlDecimalSeparator) Then
            dummy2 = InStr(newpart, Application.International(xlDecimalSeparator))
            newpart = Left(newpart, dummy2 - 1) & "." & Mid(newpart, dummy2 + 1)
         End If
         If solver_opt = "" And solver_adj <> "" Then
            If savestyle = xlA1 Then
               vbacode = excel4language.Range("okfunc").Text & " " & excel4language.Range("okarg2").Text & ":="
               vbacode = vbacode & solver_typ & ", " & excel4language.Range("okarg3").Text & ":=" & Chr(34) & newpart & Chr(34)
               vbacode = vbacode & ", " & excel4language.Range("okarg4").Text & ":=" & Chr(34) & solver_adj & Chr(34)
            Else
               vbacode = excel4language.Range("okfunc").Text & " " & excel4language.Range("okarg2").Text & ":="
               vbacode = vbacode & solver_typ & ", " & excel4language.Range("okarg3").Text & ":=" & Chr(34) & newpart & Chr(34)
               vbacode = vbacode & ", " & excel4language.Range("okarg4").Text & ":=" & Chr(34) & Application.ConvertFormula(solver_adj, xlA1, xlR1C1) & Chr(34)
            End If
            Application.RecordMacro basiccode:=vbacode
         Else
           If solver_opt <> "" And solver_adj <> "" Then
              If savestyle = xlA1 Then
                 vbacode = excel4language.Range("okfunc").Text & " " & excel4language.Range("okarg1").Text & ":=" & Chr(34) & solver_opt & Chr(34) & ", "
                 vbacode = vbacode & excel4language.Range("okarg2").Text & ":="
                 vbacode = vbacode & solver_typ & ", " & excel4language.Range("okarg3").Text & ":=" & Chr(34) & newpart & Chr(34)
                 vbacode = vbacode & ", " & excel4language.Range("okarg4").Text & ":=" & Chr(34) & solver_adj & Chr(34)
              Else
                 vbacode = excel4language.Range("okfunc").Text & " " & excel4language.Range("okarg1").Text & ":=" & Chr(34) & Application.ConvertFormula(Convert_Ref_To_US(solver_opt), xlA1, xlR1C1) & Chr(34) & ", "
                 vbacode = vbacode & excel4language.Range("okarg2").Text & ":="
                 vbacode = vbacode & solver_typ & ", " & excel4language.Range("okarg3").Text & ":=" & Chr(34) & newpart & Chr(34)
                 vbacode = vbacode & ", " & excel4language.Range("okarg4").Text & ":=" & Chr(34) & Application.ConvertFormula(solver_adj, xlA1, xlR1C1) & Chr(34)
              End If
              Application.RecordMacro basiccode:=vbacode
           End If
         End If
      End If
      Select Case action
         Case "Add"
           Application.ScreenUpdating = True
           Add_constraint
         Case "Delete"
           Delete_constraint
         Case "Change"
           Application.ScreenUpdating = True
           Change_constraint
         Case "Options"
           While action = "Options" Or action = "Save_model" Or action = "Load_model" Or action = "Saveload"
              Select Case action
              Case "Options"
                 Application.ScreenUpdating = True
                 Show_options
              Case "Save_model"
                 Application.ScreenUpdating = True
                 Save_model
              Case "Load_model"
                 Application.ScreenUpdating = True
                 Load_model
              End Select
              If action = "Saveload" Then
                 SaveLoad_ok
                 If action = "Saveload" Then
                    action = "Options"
                 ElseIf action = "Save_again" Then
                    action = "Save_model"
                 End If
              End If
           Wend
         Case "CallSolver"
           Application.StatusBar = excel4language.Range("msg_setup").Text
           Application.ScreenUpdating = False
           Define_names
           If Not dllavail Then
              MsgBox excel4language.Range("solver_msg_1a").Text, 32, , helpfile, 1830
           ElseIf Problem_ok() Then
              If ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Optimum_cell").Text = "" Then
                 oldobj = CVErr(xlErrNA)
              Else
                 oldobj = Range(Convert_Ref_To_US(Stylecheck(ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Optimum_cell").Caption))).Value
                 oldobjformat = Range(Convert_Ref_To_US(Stylecheck(ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Optimum_cell").Caption))).NumberFormatLocal
              End If
              ReDim oldvars(Range(solver_adj).Count)
              ReDim oldvarformats(Range(solver_adj).Count)
              i = 1
              For Each c In Range(solver_adj)
                 oldvars(i) = c.Value
                 oldvarformats(i) = c.NumberFormatLocal
                 i = i + 1
              Next
              Range(Stylecheck(currentarea)).Select
              answer = Application.Run("[" & ThisWorkbook.Name & "]Excel4Functions!Solvecall")
              Application.RecordMacro basiccode:=excel4language.Range("solvefunc").Text
              Application.ScreenUpdating = True
              Application.GoTo Range(Stylecheck(currentarea))
              Finish
              action = "Cancel"
           End If
      End Select
    Wend
    Application.ScreenUpdating = False
    Range(Stylecheck(currentarea)).Select
    Application.DisplayStatusBar = savestatusbar
    Application.StatusBar = False
    Application.ScreenUpdating = savescreenupdate
    Exit Sub
selectionerror:
    Range("$A$1").Select
    currentarea = Selection.Address(ReferenceStyle:=savestyle)
    Resume Next
mainerror:
    MsgBox excel4language.Range("solver_err_msg").Text, 32, , helpfile, 1830
    End
errorhandling:
    MsgBox excel4language.Range("solver_msg_1").Text, 32, , helpfile, 1830
    End
freshhandle:
    fresh = True
    Resume Next
End Sub

Private Sub Set_defaults()
    On Error GoTo mainerror
    ' sets default for fresh worksheet.
    With ThisWorkbook.DialogSheets("Solver_dialog")
'//      .EditBoxes("Optimum_Cell").Text = ActiveCell.Address(ReferenceStyle:=savestyle)
         .EditBoxes("Optimum_Cell").Text = ActiveCell.AddressLocal(ReferenceStyle:=savestyle)
         .EditBoxes("dValueof").Text = CStr(0)
'         .EditBoxes("dValueof").Enabled = False
         .OptionButtons("max_button").Value = xlOn
         .EditBoxes("Adjustable_cells").Caption = ""
         .ListBoxes("Constraint_list").RemoveAllItems
    End With
    With ThisWorkbook.DialogSheets("Options_dialog")
         .EditBoxes("Max_time").Caption = CStr(100)
         .EditBoxes("Max_iter").Caption = CStr(100)
         .EditBoxes("Precision").Caption = CStr(0.000001)
         .EditBoxes("Tolerance").Caption = CStr(5)
         .EditBoxes("Convergence").Caption = CStr(0.0001)
         .CheckBoxes("Assume").Value = xlOff
         .CheckBoxes("non_neg").Value = xlOff
         .CheckBoxes("show_iter").Value = xlOff
         .CheckBoxes("auto_scl").Value = xlOff
         .OptionButtons("Tangent").Value = xlOn
         .OptionButtons("Forward").Value = xlOn
         .OptionButtons("Newton").Value = xlOn
    End With
    Exit Sub
mainerror:
    MsgBox excel4language.Range("solver_err_msg").Text, 32, , helpfile, 1830
    End
End Sub

Public Static Sub Get_settings()
    'gets relevant setting for the worksheet, if not a fresh worksheet
    ' many options need not always be defined, so "on error resume next"
    Dim noproblem As Boolean, newopt As String, newadj As String, dummy
    Dim the_right As String, mid_ind As Integer, the_left As String, helpstring  As String
    Dim i As Integer, j As Integer, newentry As String, theindex As Integer, the_middle As String
    noproblem = True
    On Error GoTo errortrap
    newopt = ActiveSheet.Names("solver_opt")
    If noproblem Then
       ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Optimum_Cell").Caption = Get_name(newopt)
    Else
       ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Optimum_Cell").Caption = ""
    End If
    Obj
    noproblem = True
'// newadj = Range(ActiveSheet.Names("solver_adj").Name).Address(ReferenceStyle:=savestyle)
    newadj = Range(ActiveSheet.Names("solver_adj").Name).AddressLocal(ReferenceStyle:=savestyle)

    
    On Error GoTo mainerror
    If noproblem Then
       ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Adjustable_Cells").Caption = newadj
    Else
       ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Adjustable_Cells").Caption = ""
    End If
    Adjustables
    On Error Resume Next
    helpstring = CStr(0)
    helpstring = Mid(CStr(ActiveSheet.Names("solver_val")), 2)
    ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("dValueof").Text = CStr(CDbl(Val(helpstring)))
    helpstring = "=1"
    helpstring = CStr(ActiveSheet.Names("solver_typ"))
    Select Case helpstring
       Case "=1"
'         ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("dValueof").Enabled = False
         ThisWorkbook.DialogSheets("Solver_dialog").OptionButtons("max_button").Value = xlOn
         solver_typ = 1
       Case "=2"
'         ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("dValueof").Enabled = False
         ThisWorkbook.DialogSheets("Solver_dialog").OptionButtons("min_button").Value = xlOn
         solver_typ = 2
       Case "=3"
'         ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("dValueof").Enabled = True
         ThisWorkbook.DialogSheets("Solver_dialog").OptionButtons("value_button").Value = xlOn
         solver_typ = 3
    End Select
    ThisWorkbook.DialogSheets("Solver_dialog").ListBoxes("Constraint_list").RemoveAllItems
    solver_num = 0
    solver_num = CDbl(Mid(CStr(ActiveSheet.Names("solver_num")), 2))
'/ .................................................................................................... /
    
    For i = 1 To solver_num
       
       the_left = Mid(CStr(ActiveSheet.Names("solver_lhs" & Trim(Str(i)))), 2)

       the_left = Get_name(Range(Convert_Ref_To_US(the_left)).Address)
       
    '/ If we didn't get a name back, we need to LOCAL version of the Reference
       If (the_left = Application.ConvertFormula(Range(the_left).Address, xlA1, xlR1C1)) _
       Then
          the_left = Range(Mid(CStr(ActiveSheet.Names("solver_lhs" & Trim(Str(i)))), 2)).AddressLocal(ReferenceStyle:=Application.ReferenceStyle)
       End If
       
       If Len(the_left) > 120 Then
'//       the_left = Range(the_left).Address
          the_left = Range(the_left).AddressLocal
       End If
       
       mid_ind = CDbl(Mid(CStr(ActiveSheet.Names("solver_rel" & Trim(Str(i)))), 2))
       
       If mid_ind < 4 Then
         
         the_right = Mid(CStr(ActiveSheet.Names("solver_rhs" & Trim(Str(i))).RefersToLocal), 2)
         
         If Not IsNumeric(the_right) Then
            On Error Resume Next
            Err = 0
            
            
'////////////////////////////////////////////////////////////////////////////////////

            the_right = Get_name(Range(Convert_Ref_To_US(the_right)).Address)

'////////////////////////////////////////////////////////////////////////////////////
            
            If Err > 0 Then
            
'/ .................................................................................................... /

               ' formula
               j = InStr(the_right, ActiveSheet.Name)
               If j <> 0 Then
                  If InStr(the_right, "'" & ActiveSheet.Name & "'!") <> 0 Then
                     j = InStr(the_right, "'" & ActiveSheet.Name & "'!")
                     Do While j <> 0
                        the_right = Left(the_right, j - 1) & Right(the_right, Len(the_right) - j - Len(ActiveSheet.Name) - 2)
                        j = InStr(the_right, "'" & ActiveSheet.Name & "'!")
                     Loop
                  Else
                     Do While j <> 0
                        the_right = Left(the_right, j - 1) & Right(the_right, Len(the_right) - j - Len(ActiveSheet.Name))
                        j = InStr(the_right, ActiveSheet.Name)
                     Loop
                  End If
               End If
               
               If "." <> Application.International(xlDecimalSeparator) Then
                  j = InStr(the_right, ".")
                  Do While j <> 0
                      Mid(the_right, j, 1) = Application.International(xlDecimalSeparator)
                      j = InStr(the_right, ".")
                  Loop
               End If
            
'/ .................................................................................................... /
            
            Else
         
'/ .................................................................................................... /
            
            '/ If we didn't get a name back, we need to LOCAL version of the Reference
               If (the_right = Application.ConvertFormula(Range(the_right).Address, xlA1, xlR1C1)) _
               Then
                  the_right = Range(Mid(CStr(ActiveSheet.Names("solver_rhs" & Trim(Str(i)))), 2)).AddressLocal(ReferenceStyle:=Application.ReferenceStyle)
               End If
       
               If Len(the_right) > 120 Then
                  the_right = Mid(CStr(ActiveSheet.Names("solver_rhs" & Trim(Str(i)))), 2)
                  
                  If InStr(the_right, ActiveSheet.Name & "!") <> 0 Then
                     If InStr(the_right, "'" & ActiveSheet.Name & "'!") <> 0 Then
                        j = InStr(the_right, "'" & ActiveSheet.Name & "'!")
                        the_right = Right(the_right, Len(the_right) - j - Len(ActiveSheet.Name) - 2)
                     Else
                        j = InStr(the_right, ActiveSheet.Name & "!")
                        the_right = Right(the_right, Len(the_right) - j - Len(ActiveSheet.Name))
                     End If
                  End If
               End If
            End If
'/ .................................................................................................... /
         
         Else
'/ .................................................................................................... /
            
            the_right = CStr(CDbl(the_right))
'/ .................................................................................................... /
         
         End If
'/ .................................................................................................... /
         
         the_middle = ThisWorkbook.DialogSheets("Add_dialog").DropDowns("Options").List(mid_ind)
'/ .................................................................................................... /
       
       ElseIf mid_ind = 4 Then
'/ .................................................................................................... /
         
         the_right = excel4language.Range("solver_msg_int").Text
         the_middle = "="
       ElseIf mid_ind = 5 Then
         the_right = excel4language.Range("solver_msg_bin").Text
         the_middle = "="
       End If
       newentry = the_left & " " & the_middle & " " & Trim(the_right)
       If i > 1 Then
          theindex = search(newentry, 1, ThisWorkbook.DialogSheets("Solver_dialog").ListBoxes("Constraint_list").ListCount)
       Else
          theindex = 0
       End If
       If theindex = 0 Then
          ThisWorkbook.DialogSheets("Solver_dialog").ListBoxes("Constraint_list").AddItem Text:=newentry
       Else
          ThisWorkbook.DialogSheets("Solver_dialog").ListBoxes("Constraint_list").AddItem Text:=newentry, Index:=theindex
       End If
    Next
    On Error GoTo errorhandler
    With ThisWorkbook.DialogSheets("Options_dialog")
         .EditBoxes("Max_time").Caption = CStr(CDbl(Mid(CStr(ActiveSheet.Names("solver_tim").RefersToLocal), 2)))
         .EditBoxes("Max_iter").Caption = CStr(CDbl(Mid(CStr(ActiveSheet.Names("solver_itr").RefersToLocal), 2)))
         .EditBoxes("Precision").Caption = CStr(CDbl(Mid(CStr(ActiveSheet.Names("solver_pre").RefersToLocal), 2)))
         .EditBoxes("Tolerance").Caption = CStr(CDbl(Mid(CStr(ActiveSheet.Names("solver_tol").RefersToLocal), 2)) * 100)
         'new convergence option will not always be available, so..
         On Error Resume Next
         .EditBoxes("Convergence").Caption = CStr(0.0001)
         .EditBoxes("Convergence").Caption = CStr(CDbl(Mid(CStr(ActiveSheet.Names("solver_cvg").RefersToLocal), 2)))
         On Error GoTo errorhandler
         If CStr(ActiveSheet.Names("solver_lin")) = "=1" Then
            .CheckBoxes("Assume").Value = xlOn
         Else
            .CheckBoxes("Assume").Value = xlOff
         End If
         ' new option nonneg will not always be there, so..
         On Error Resume Next
         If CStr(ActiveSheet.Names("solver_neg")) <> "=1" Then
            .CheckBoxes("non_neg").Value = xlOff
         Else
            .CheckBoxes("non_neg").Value = xlOn
         End If
         On Error GoTo errorhandler
         If CStr(ActiveSheet.Names("solver_sho")) = "=1" Then
            .CheckBoxes("Show_iter").Value = xlOn
         Else
            .CheckBoxes("Show_iter").Value = xlOff
         End If
         If CStr(ActiveSheet.Names("solver_scl")) = "=1" Then
            .CheckBoxes("auto_scl").Value = xlOn
         Else
            .CheckBoxes("auto_scl").Value = xlOff
         End If
         On Error GoTo errorhandler
         If CStr(ActiveSheet.Names("solver_est")) = "=1" Then
            .OptionButtons("Tangent").Value = xlOn
            .OptionButtons("Quadratic").Value = xlOff
         Else
            .OptionButtons("Tangent").Value = xlOff
            .OptionButtons("Quadratic").Value = xlOn
         End If
         If CStr(ActiveSheet.Names("solver_drv")) = "=1" Then
            .OptionButtons("Forward").Value = xlOn
            .OptionButtons("Central").Value = xlOff
         Else
            .OptionButtons("Forward").Value = xlOff
            .OptionButtons("Central").Value = xlOn
         End If
         If CStr(ActiveSheet.Names("solver_nwt")) = "=1" Then
            .OptionButtons("Newton").Value = xlOn
            .OptionButtons("Conjugate").Value = xlOff
         Else
            .OptionButtons("Newton").Value = xlOff
            .OptionButtons("Conjugate").Value = xlOn
         End If
    End With
    Exit Sub
mainerror:
    MsgBox excel4language.Range("solver_err_msg").Text, 32, , helpfile, 1830
    End
errorhandler:
    With ThisWorkbook.DialogSheets("Options_dialog")
         .EditBoxes("Max_time").Caption = CStr(100)
         .EditBoxes("Max_iter").Caption = CStr(100)
         .EditBoxes("Precision").Caption = CStr(0.000001)
         .EditBoxes("Tolerance").Caption = CStr(5)
         .EditBoxes("Convergence").Caption = CStr(0.0001)
         .CheckBoxes("Assume").Value = xlOff
         .CheckBoxes("non_neg").Value = xlOff
         .CheckBoxes("show_iter").Value = xlOff
         .CheckBoxes("auto_scl").Value = xlOff
         .OptionButtons("Tangent").Value = xlOn
         .OptionButtons("Forward").Value = xlOn
         .OptionButtons("Newton").Value = xlOn
    End With
    Exit Sub
errortrap:
    noproblem = False
    Resume Next
End Sub

Sub SolverName()
   Set excel4language = ThisWorkbook.Worksheets("Language")
   Set excel4sheet = ThisWorkbook.Excel4MacroSheets("Excel4Functions")
   Dim i As Integer
   If Left(Application.OperatingSystem, 1) = "W" Then
      helpfile = "xladdin.chm"
   Else
      helpfile = ":MS EXCEL HELP"
   End If
   If Workbooks.Count = 0 Then
       MsgBox excel4language.Range("solver_msg_150").Text, 32, , helpfile, 1830
       End
   End If
   savestyle = Application.ReferenceStyle
   If Not AutoOpened Then
      Auto_open
   End If
End Sub

Function Namefix(thestring)
    ' This procedure doubles the "'s inside its argument.
    ' This is necessary to avoid recording problems on sheets with quotes in their names!!!
    Dim newstring As String, i As Integer
    On Error GoTo errorhandle
    ReDim placeholders(Len(thestring) + 1) As String
    For i = 1 To Len(thestring)
        placeholders(i) = Mid(thestring, i, 1)
        If placeholders(i) = Chr(34) Then
           placeholders(i) = Chr(34) & Chr(34)
        End If
    Next
    newstring = ""
    For i = 1 To Len(thestring)
       newstring = newstring & placeholders(i)
    Next
    Namefix = newstring
    Exit Function
errorhandle:
    Namefix = ""
End Function

Function search(entry As String, start As Integer, theend As Integer)
    If theend <= start Then
       If entry < ThisWorkbook.DialogSheets("Solver_dialog").ListBoxes("Constraint_list").List(start) Then
          search = start
       Else
          search = start + 1
       End If
       Exit Function
    End If
    If entry > ThisWorkbook.DialogSheets("Solver_dialog").ListBoxes("Constraint_list").List(Int((theend + start) / 2)) Then
       search = search(entry, Int((theend + start) / 2) + 1, theend)
    Else
       search = search(entry, start, Int((theend + start) / 2) - 1)
    End If
End Function

Function Stylecheck(thestring) As String
   On Error GoTo iferror
   If savestyle = xlA1 Then
      Stylecheck = thestring
   Else
      Stylecheck = Application.ConvertFormula(thestring, xlR1C1, xlA1)
   End If
   Exit Function
iferror:
   Stylecheck = thestring
End Function

Public Static Sub SaveLoad_ok()
    ' user presses "ok" on load or save model
    On Error GoTo mainerror
    Dim k As Integer, mainstring As String
    Dim c, the_answer As Integer
    Dim theoptions As String, var_done As Boolean
    Dim dummy, vbacode As String, obj_done As Boolean
    Application.ScreenUpdating = False
    If ThisWorkbook.DialogSheets("Save_dialog").DialogFrame.Caption = excel4language.Range("solver_msg_46").Text Then
       DoTheSave
    Else
        ' load model
       If ThisWorkbook.DialogSheets("Solver_dialog").ListBoxes("Constraint_list").ListCount <> 0 Or _
          ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Adjustable_cells").Caption <> "" Then
             Application.ScreenUpdating = True
             the_answer = MsgBox(excel4language.Range("solver_msg_5").Text, 33, , helpfile, 1830)
             If the_answer <> 1 Then
                Exit Sub
             End If
       End If
       Application.ScreenUpdating = False
       Reset_all (False)
       If InStr(ThisWorkbook.DialogSheets("Save_dialog").EditBoxes("The_area").Caption, "!") = 0 Then
          vbacode = excel4language.Range("loadfunc").Text & " " & excel4language.Range("loadarg1").Text & ":=" & Chr(34) & ThisWorkbook.DialogSheets("Save_dialog").EditBoxes("The_area").Caption & Chr(34)
       Else
          If InStr(ThisWorkbook.DialogSheets("Save_dialog").EditBoxes("The_area").Caption, Chr(34)) = 0 Then
             vbacode = excel4language.Range("loadfunc").Text & " " & excel4language.Range("loadarg1").Text & ":=" & Chr(34) & ThisWorkbook.DialogSheets("Save_dialog").EditBoxes("The_area").Caption & Chr(34)
          Else
             vbacode = excel4language.Range("loadfunc").Text & " " & excel4language.Range("loadarg1").Text & ":=" & Chr(34) & Namefix(ThisWorkbook.DialogSheets("Save_dialog").EditBoxes("The_area").Caption) & Chr(34)
          End If
       End If
       Application.RecordMacro basiccode:=vbacode
       On Error GoTo loaderror
       obj_done = False
       var_done = False
       For Each c In Range(Stylecheck(Convert_Ref_To_US(ThisWorkbook.DialogSheets("Save_dialog").EditBoxes("The_area").Caption)))
          If Not IsEmpty(c) Then
             On Error GoTo loaderror
             If Not InStr(c.Formula, "=") = 0 Then
                mainstring = c.Formula
                If "." <> Application.International(xlDecimalSeparator) Then
                   dummy = InStr(mainstring, ".")
                   Do While dummy <> 0
                      Mid(mainstring, dummy, 1) = Application.International(xlDecimalSeparator)
                      dummy = InStr(mainstring, ".")
                   Loop
                End If
                If Left(mainstring, 4) = "=MIN" Then
                   On Error GoTo loaderror2
                   ThisWorkbook.DialogSheets("Solver_dialog").OptionButtons("Min_button").Value = xlOn
                   ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Optimum_cell").Caption = Get_name(Mid(mainstring, 6, Len(mainstring) - 6))
                   With ActiveSheet.Names
                       .Add Name:="solver_typ", RefersTo:=2, Visible:=False
                       .Add Name:="solver_opt", RefersToLocal:="=" & Range(Mid(mainstring, 6, Len(mainstring) - 6)).Address, Visible:=False
                       .Add Name:="solver_val", RefersTo:=0, Visible:=False
                   End With
                   ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("dvalueof").Caption = CStr(0)
                   solver_typ = 2
                ElseIf Left(mainstring, 4) = "=MAX" Then
                   On Error GoTo loaderror2
                   ThisWorkbook.DialogSheets("Solver_dialog").OptionButtons("Max_button").Value = xlOn
                   ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Optimum_cell").Caption = Get_name(Mid(mainstring, 6, Len(mainstring) - 6))
                   With ActiveSheet.Names
                       .Add Name:="solver_opt", RefersTo:="=" & Range(Mid(mainstring, 6, Len(mainstring) - 6)).Address, Visible:=False
                       .Add Name:="solver_typ", RefersTo:=1, Visible:=False
                       .Add Name:="solver_val", RefersTo:=0, Visible:=False
                   End With
                   ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("dvalueof").Caption = CStr(0)
                   solver_typ = 1
                ElseIf InStr(mainstring, "COUNT") = 0 And InStr(mainstring, Application.International(xlListSeparator)) = 0 And Not obj_done Then
                   On Error GoTo loaderror2
                   ThisWorkbook.DialogSheets("Solver_dialog").OptionButtons("Value_button").Value = xlOn
                   ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Optimum_cell").Caption = Get_name(Mid(mainstring, 2, InStr(2, mainstring, "=") - 2))
                   ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("dvalueof").Caption = CStr(CDbl(Mid(mainstring, InStr(2, c.Formula, "=") + 1)))
   '                ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("dvalueof").Enabled = True
                   With ActiveSheet.Names
                       .Add Name:="solver_opt", RefersTo:="=" & Range(Mid(mainstring, 2, InStr(2, mainstring, "=") - 2)).Address, Visible:=False
                       .Add Name:="solver_typ", RefersTo:=3, Visible:=False
                       .Add Name:="solver_val", RefersToLocal:=Mid(mainstring, InStr(2, mainstring, "=") + 1), Visible:=False
                   End With
                   solver_typ = 3
                ElseIf Left(mainstring, 7) = "=COUNTA" Then
                   On Error GoTo loaderror3
                   If Application.ReferenceStyle = xlA1 Then
                      ThisWorkbook.DialogSheets("solver_dialog").EditBoxes("Adjustable_cells").Caption = Mid(mainstring, 9, Len(mainstring) - 9)
                   Else
                      ThisWorkbook.DialogSheets("solver_dialog").EditBoxes("Adjustable_cells").Caption = Application.ConvertFormula(Mid(mainstring, 9, Len(mainstring) - 9), xlA1, xlR1C1)
                   End If
                   var_done = True
                   Adjustables
                   Define_names
                ElseIf Left(mainstring, 6) = "=COUNT" Then
                   On Error GoTo loaderror3
                   If Application.ReferenceStyle = xlA1 Then
                      ThisWorkbook.DialogSheets("solver_dialog").EditBoxes("Adjustable_cells").Caption = Mid(mainstring, 8, Len(mainstring) - 8)
                   Else
                      ThisWorkbook.DialogSheets("solver_dialog").EditBoxes("Adjustable_cells").Caption = Application.ConvertFormula(Mid(mainstring, 8, Len(mainstring) - 8), xlA1, xlR1C1)
                   End If
                   var_done = True
                   Adjustables
                   Define_names
                ElseIf InStr(2, mainstring, "=") = 0 And InStr(2, mainstring, "<=") = 0 And InStr(2, mainstring, ">=") = 0 And InStr(mainstring, "=INT") = 0 Then
                   If Left(mainstring, 4) = "=VAR" Then
                      theoptions = Trim(Mid(mainstring, 6, Len(mainstring) - 6))
                   Else
                      theoptions = Trim(Mid(mainstring, 3, Len(mainstring) - 3))
                   End If
                   Dim ol(1 To 11) As String
                   For k = 1 To 11
                       ol(k) = ""
                   Next
                   For k = 1 To 11
                      ol(k) = Left(theoptions, InStr(theoptions, Application.International(xlListSeparator)) - 1)
                      theoptions = Mid(theoptions, Len(ol(k)) + 2)
                      If InStr(theoptions, Application.International(xlListSeparator)) = 0 And k < 10 Then
                         ol(k + 1) = theoptions
                         theoptions = ""
                         Exit For
                      End If
                   Next
                   dummy = solver_options2(ol(1), ol(2), ol(3), ol(4), ol(5), ol(6), ol(7), ol(8), ol(9), ol(10), ol(11), theoptions)
                   Exit For
                ElseIf InStr(2, mainstring, "<=") > 0 Then
                   ThisWorkbook.DialogSheets("add_dialog").DropDowns("Options").ListIndex = 1
                   If Left(mainstring, 4) = "=SUM" Then
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("rhs").Caption = Mid(mainstring, InStr(2, mainstring, "=") + 5, Len(mainstring) - InStr(2, mainstring, "=") - 5)
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 6, InStr(2, mainstring, "<=") - 7)
                   Else
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("rhs").Caption = Mid(mainstring, InStr(2, mainstring, "=") + 1, Len(mainstring) - InStr(2, mainstring, "="))
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 3, InStr(2, mainstring, "<=") - 3)
                   End If
                   If Not Valid_constraint(False) Then
                      MsgBox excel4language.Range("solver_msg_6").Text, 32, , helpfile, 1830
                   End If
                ElseIf InStr(2, mainstring, ">=") > 0 Then
                   ThisWorkbook.DialogSheets("add_dialog").DropDowns("Options").ListIndex = 3
                   If Left(mainstring, 4) = "=SUM" Then
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("rhs").Caption = Mid(mainstring, InStr(2, mainstring, "=") + 5, Len(mainstring) - InStr(2, mainstring, "=") - 5)
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 6, InStr(2, mainstring, ">=") - 7)
                   Else
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("rhs").Caption = Mid(mainstring, InStr(2, mainstring, "=") + 1, Len(mainstring) - InStr(2, mainstring, "="))
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 3, InStr(2, mainstring, ">=") - 3)
                   End If
                   If Not Valid_constraint(False) Then
                      MsgBox excel4language.Range("solver_msg_6").Text, 32, , helpfile, 1830
                   End If
                ElseIf InStr(mainstring, "=INT") > 0 Then
                   ThisWorkbook.DialogSheets("add_dialog").DropDowns("Options").ListIndex = 4
                   ThisWorkbook.DialogSheets("add_dialog").EditBoxes("rhs").Caption = excel4language.Range("solver_msg_int").Text
                   If Left(mainstring, 4) = "=INT" Then
                      If Right(mainstring, 4) = "))=1" Then
                         ThisWorkbook.DialogSheets("add_dialog").DropDowns("Options").ListIndex = 5
                         ThisWorkbook.DialogSheets("add_dialog").EditBoxes("rhs").Caption = excel4language.Range("solver_msg_bin").Text
                         ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 10, Len(mainstring) - 13)
                      Else
                         ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 10, Len(mainstring) - 11)
                      End If
                   Else
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 3, InStr(2, mainstring, "=") - 3)
                   End If
                   If Not Valid_constraint(False) Then
                      MsgBox excel4language.Range("solver_msg_6").Text, 32, , helpfile, 1830
                   End If
                ElseIf InStr(2, mainstring, "=0)+(") > 0 Then
                   ThisWorkbook.DialogSheets("add_dialog").DropDowns("Options").ListIndex = 5
                   ThisWorkbook.DialogSheets("add_dialog").EditBoxes("rhs").Caption = excel4language.Range("solver_msg_bin").Text
                   ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 3, InStr(2, mainstring, "=") - 3)
                   If Not Valid_constraint(False) Then
                      MsgBox excel4language.Range("solver_msg_6").Text, 32, , helpfile, 1830
                   End If
                ElseIf InStr(2, mainstring, "=") > 0 Then
                   ThisWorkbook.DialogSheets("add_dialog").DropDowns("Options").ListIndex = 2
                   If Left(mainstring, 4) = "=SUM" Then
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("rhs").Caption = Mid(mainstring, InStr(2, mainstring, "=") + 5, Len(mainstring) - InStr(2, mainstring, "=") - 5)
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 6, InStr(2, mainstring, "=") - 7)
                   Else
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("rhs").Caption = Mid(mainstring, InStr(2, mainstring, "=") + 1, Len(mainstring) - InStr(2, mainstring, "="))
                      ThisWorkbook.DialogSheets("add_dialog").EditBoxes("lhs").Caption = Mid(mainstring, 3, InStr(2, mainstring, "=") - 3)
                   End If
                   If Not Valid_constraint(False) Then
                      MsgBox excel4language.Range("solver_msg_6").Text, 32, , helpfile, 1830
                   End If
                Else
                   MsgBox excel4language.Range("solver_msg_6").Text, 32, , helpfile, 1830
                End If
                obj_done = True
             End If
          End If
       Next
    End If
    Application.ScreenUpdating = True
    Exit Sub
loaderror:
    If obj_done = False Then
       GoTo loaderror2
    End If
    If var_done = False Then
       GoTo loaderror3
    End If
    Application.ScreenUpdating = True
    MsgBox excel4language.Range("solver_msg_6").Text, 32, , helpfile, 1830
    Exit Sub
loaderror2:
    Application.ScreenUpdating = True
    MsgBox excel4language.Range("solver_msg_6b").Text, 32, , helpfile, 1830
    Exit Sub
loaderror3:
    Application.ScreenUpdating = True
    MsgBox excel4language.Range("solver_msg_6c").Text, 32, , helpfile, 1830
    Exit Sub
mainerror:
    MsgBox excel4language.Range("solver_err_msg").Text, 32, , helpfile, 1830
    End
End Sub




Attribute VB_Name = "Solver2"
Option Explicit

Public Sub Auto_open()
    Dim dmy As String, disp As Boolean
    If AutoOpened Then
      ' Exit Sub
    End If
    AutoOpened = True
    Application.ScreenUpdating = False
    ' creat the Excel4 sheet
    With ThisWorkbook
       Err.Clear
       On Error Resume Next
       dmy = .Excel4MacroSheets(1).Name
       If Err = 0 Then
          disp = Application.DisplayAlerts
          Application.DisplayAlerts = False
          .Excel4MacroSheets(1).Delete
          Application.DisplayAlerts = disp
       End If
       Err.Clear
       .Worksheets.Add Type:=xlExcel4MacroSheet
       .Excel4MacroSheets(1).Name = "Excel4Functions"
       With .Sheets("Excel4Functions")
        ' add the code
           .Cells(1, 1).Formula = "Start of solver call"
           .Names.Add Name:="SolveCall", RefersToR1C1:="=Excel4Functions!R1C1"
           .Cells(2, 1).Formula = "=ERROR(FALSE)"
           .Cells(3, 1).Formula = "=CALL(SolveDLL,0)"
           .Names.Add Name:="TheCall", RefersToR1C1:="=Excel4Functions!R3C1"
           .Cells(4, 1).Formula = "=ERROR(TRUE)"
           .Cells(5, 1).Formula = "=IF(ISERROR(TheCall))"
           .Cells(6, 1).Formula = "=SET.VALUE(TheCall,9)"
           .Cells(7, 1).Formula = "=END.IF()"
           .Cells(8, 1).Formula = "=RETURN(TheCall)"

           .Cells(10, 1).Formula = "=UNREGISTER(SolveDLL)"
           .Names.Add Name:="unregi", RefersToR1C1:="=Excel4Functions!R10C1"
           .Cells(11, 1).Formula = "=RETURN()"

           .Cells(13, 1).Formula = "=REGISTER(GET.DOCUMENT(2,GET.CELL(32,A1)) & IF(LEFT(GET.WORKSPACE(1),1)=""M"","":Solver Add-In"",""\SOLVER32""),""Solve"",""IE"")"
           .Names.Add Name:="SolveDLL", RefersToR1C1:="=Excel4Functions!R13C1"
           .Cells(14, 1).Formula = "=RETURN()"
           .Names.Add Name:="solver_table", RefersToR1C1:="=Excel4Functions!R25C2"
           .Names.Add Name:="solver_tbl", RefersToR1C1:="=Excel4Functions!R25C2"
           
           .Cells(16, 1).Formula = "=ARGUMENT(""show_case"",1)"
           .Names.Add Name:="Show", RefersToR1C1:="=Excel4Functions!R16C1"
           .Cells(17, 1).Formula = "=IF(dShowref<>"""")"
           .Cells(18, 1).Formula = "=  FORMULA(""=""&dShowref&""(""&show_case&"")"",ShowForm)"
           .Cells(19, 1).Formula = "=ELSE()"
           .Cells(20, 1).Formula = "=  FORMULA(""=ShowMe(""&show_case&"")"",ShowForm)"
           .Cells(21, 1).Formula = "=END.IF()"
           .Cells(22, 1).Formula = "=Showme(1)"
           .Names.Add Name:="Showform", RefersToR1C1:="=Excel4Functions!R22C1"
           .Cells(23, 1).Formula = "=RETURN(ShowForm)"
           .Names.Add Name:="dShowref", RefersToR1C1:="=Excel4Functions!R1C2"
                      
           .Cells(25, 1).Formula = "Update the Menu"
           .Names.Add Name:="TheMenu", RefersToR1C1:="=Excel4Functions!R25C1"
           .Cells(26, 1).Formula = "=GET.BAR(10,SolverMenubar,SolverMenuitem)"
           .Names.Add Name:="MenuUpdate", RefersToR1C1:="=Excel4Functions!R26C1"
           .Cells(27, 1).Formula = "=IF(NOT(ISERROR(MenuUpdate)))"
           .Cells(28, 1).Formula = "=  DELETE.COMMAND(10,SolverMenubar,SolverMenuitem)"
           .Cells(29, 1).Formula = "=  ADD.COMMAND(10,SolverMenubar,SolverMenu,MenuUpdate)"
           .Cells(30, 1).Formula = "=ELSE()"
           .Cells(31, 1).Formula = "=  ADD.COMMAND(10,SolverMenubar,SolverMenu,""---"")"
           .Cells(32, 1).Formula = "=END.IF()"
           .Cells(33, 1).Formula = "=RETURN()"
        End With
    End With
    
    ' Register DLL
    Application.Run ("[" & ThisWorkbook.Name & "]Excel4Functions!SolveDll")
    
    ' Now update the menu
    Application.Run ("[" & ThisWorkbook.Name & "]Excel4Functions!TheMenu")
    
    Application.ScreenUpdating = True
End Sub

Public Sub Auto_close()
    Application.ScreenUpdating = False
    On Error Resume Next
    Application.Run ("[" & ThisWorkbook.Name & "]Excel4Functions!Unregi")
    ThisWorkbook.Worksheets("Excel4Functions").Delete
    Application.ScreenUpdating = True
End Sub

Public Sub Cont_button()
    ' called when user presses continue on "show" stop.
    stop_solver = False
End Sub

Public Sub Stop_button()
    ' called when user presses stop on "show" stop
    stop_solver = True
End Sub

Public Sub Push_add()
    ' user presses "add" button
    action = "Add"
    change = False
End Sub

Public Sub Push_close()
    action = "Cancel"
End Sub

Public Sub Push_delete()
    ' user presses "delete" button
    If ThisWorkbook.DialogSheets("Solver_dialog").ListBoxes("Constraint_list").ListIndex = 0 Then
       Application.ScreenUpdating = True
       MsgBox excel4language.Range("solver_msg_25b").Text, 32, , helpfile, 1830
       action = ""
    Else
       action = "Delete"
    End If
End Sub

Public Sub Push_guess()
    'user hits "guess" button
    Dim prec As Integer
    On Error GoTo guesserror
    Obj
    action = "Guess"
    With ThisWorkbook.DialogSheets("Solver_dialog")
        If .EditBoxes("Optimum_cell").Caption = "" Then
           MsgBox excel4language.Range("solver_msg_3").Text, 32, , helpfile, 1830
           .Focus = .EditBoxes("Optimum_cell").Name
           Exit Sub
        End If
        If solver_opt = "" Then
           .Focus = .EditBoxes("Optimum_cell").Name
           Exit Sub
        End If
        If Not Range(Stylecheck(Convert_Ref_To_US(.EditBoxes("Optimum_cell").Caption))).HasFormula Then
           MsgBox excel4language.Range("solver_msg_4").Text, 32, , helpfile, 1830
           .Focus = .EditBoxes("Optimum_cell").Name
           Exit Sub
        Else
           prec = Range(Stylecheck(Convert_Ref_To_US(.EditBoxes("Optimum_Cell").Caption))).Precedents.Count
           If prec = 1 Then
              If Range(Stylecheck(Convert_Ref_To_US(.EditBoxes("Optimum_Cell").Caption))).Precedents.HasFormula Then
                 .EditBoxes("Adjustable_cells").Caption = ""
              Else
                 .EditBoxes("Adjustable_cells").Caption = Range(Stylecheck(Convert_Ref_To_US(.EditBoxes("Optimum_Cell").Caption))).Precedents.AddressLocal(ReferenceStyle:=savestyle)
              End If
           Else
              .EditBoxes("Adjustable_cells").Caption = Range(Stylecheck(Convert_Ref_To_US(.EditBoxes("Optimum_Cell").Caption))).Precedents.SpecialCells(xlConstants).AddressLocal(ReferenceStyle:=savestyle)
           End If
        End If
    End With
    Adjustables
    Exit Sub
guesserror:
    MsgBox excel4language.Range("solver_msg_4").Text, 32, , helpfile, 1830
    ThisWorkbook.DialogSheets("Solver_dialog").Focus = ThisWorkbook.DialogSheets("Solver_dialog").EditBoxes("Optimum_cell").Name
    Exit Sub
End Sub

Public Sub Push_change()
    ' user hits "Change" button
    action = "Change"
    change = True
End Sub

Public Sub Push_options()
    ' user presses "options" button
    action = "Options"
End Sub

Public Sub Push_reset()
    ' user presses "reset"
    action = "Continue"
    Reset_all (True)
End Sub

Public Sub Push_save()
    ' user presses "save model"
    action = "Save_model"
End Sub

Public Sub Push_load()
…