4 Replies Latest reply: May 15, 2014 10:06 AM by Grant Perkins RSS

    Export to Excel using monarch cell

    Mfinancial _

      Hi, I am trying to export a table to excel but instead of using a static export file name I would like to use a cell within the table or the source file name.  Thanks for the help in advance!

        • Export to Excel using monarch cell
          Data Kruncher

          Unfortunately, there's no way within Monarch to do what you want, but if you put your report file in a folder without any other report files, you could use a batch file like this:


          For %%i in (*.txt) Do Call :DoMonarch "%%i"

          GOTO :EOF



          ("C:\Program Files\Monarch\Program\Monarch.exe" /rpt:"%1" /mod:"ModelName.xmod" /exp:"%1.xls" /T /exptable:"%~1" /expfileopt:overwrite)

          GOTO :EOF

          /codeStore the batch file and the model file in the same folder as the report files.


          This will use the full report file name (including the extension) as the name of the Excel file, but that won't matter. Windows will still see it as being an Excel file.


          Alternatively, there's a method in which you can use a project to export a text file with only a single value (no headings), and then have a DOS batch file read the value in that file into memory. Finally rename the Excel export using the contents of the memory variable.