0 Replies Latest reply: Jan 8, 2010 1:07 PM by dfeld71 _ RSS

    automating project export

    dfeld71 _

      Hi everyone -

      I am relatively new to Monarch, and have a question that may seem basic, but here goes....


      I have created a Project, and within that a Project Export.  Does anyone know how I can get the PRJ to run the Export automatically?  What is happening now, is that when I click the PRJ, the Model opens and takes me to the Table, but then I have to manually do File, Project Export to get it to run.


      Thank you, in advance, for your assistance!



        • automating project export
          Data Kruncher

          Hi Deb. Welcome to the forum!


          There aren't any settings to direct Monarch to run project exports automatically when a project is loaded, but you can still do what you want pretty easily.


          The answer lies in creating a Windows batch file. You can direct windows to run Monarch and, via a mechanism known as "command line parameters", simultaneously open a project file and run your export(s). Run Notepad and type something like this:

          https://community.datawatch.com/code"C:\Program Files\Monarch\Program\Monarch.exe" /prj:"C:\MyFolder\MyProject.xprj" /pxall[/code]and save the file to your desktop as "ProjectExport.bat".


          Edit as necessary to indicate the proper path for the Monarch program and for your project file.


          Now just double-click the batch file icon to execute the export.


          For more information about automating Monarch via batch files, and to get a free tool that will build Monarch batch files for you by stepping you through the various options available to you, please visit [URL is no longer valid]


          If you're interested in gaining even better control of automating Monarch, you can subscribe to the Feedburner email service to receive [URL is no longer valid] site updates by email and you'll also receive a free tool that helps with programming Monarch via Excel.



          Data Kruncher

            • automating project export
              timdasch _

              I found this post which addresses my need also.  However, when I created my bat file, it just launched the pgm and project, but did not export nor terminate.  THEN, I noticed the scroll bar above and finally saw the /pxall parameter - BINGO, works like a champ!


                • automating project export
                  elginreigner _

                  You can also specify which export to run by using the switch "/PX: is the name of your export.

                    • automating project export
                      whathetin _



                      I was reading through these posts and I'm looking to convert several files into excel on a daily basis.  I have over 100 files that I convert into excel through monarch 6.0.  Is the macro created in[URL is no longer valid] compatible with version 6.0?

                        • automating project export
                          Data Kruncher

                          Welcome to the forum whathetin.


                          The command line rules for Monarch v6 (and earlier) are a little different from those of later versions, in that the available parameters are fewer, and they must appear in a specific order. For Monarch v7 and later, there are more possible parameters, and the order in which you use them doesn't matter.


                          For v6, you must use at least of these structures:


                          Monarch report_name model_name[/code]or


                          Monarch project_name[/code]then you can choose to follow one of those with any of these:




                          /R or /T or /S (to have your session open the Report, Table or Summary window)


                          /I to include the tree index if you're exporting to a portable report file (prf)


                          /M to include the model file if you're exporting to a portable report file  (prf)


                          /D to, well, I can't find what /D does. :o Anybody?


                          /E to encrypt the file if you're exporting to a portable report file  (prf)


                          Because the choices are pretty limited with v6, and because it was really developed to support later versions, I'd pass on using the Batch File Generator with it (but definitely use it for later Monarch versions!).


                          Then again, you could give it a try and just edit the resultant batch file yourself to strip out the unrecognized parameters like /rpt:, /mod: and /prj:.

                            • automating project export
                              whathetin _

                              Thanks for your quick response.  I am obviously very new to this and I don't know where to start with creating a command line.  The Help Topic section wasn't very helpful.  I have several projects created and I would like to automatically export these projects to excel.  I access Monarch v6.0 remotely and do not have the application installed on my computer.  Would this hinder me from creating a batch file?

                                • automating project export
                                  Data Kruncher

                                  No, using Monarch remotely shouldn't be a problem for creating batch files, though you'll need to know the full path name of Monarch on the server.


                                  You'll likely find it to be something like


                                  Then use


                                  server\programs\Monarch\Program\Monarch.exe reportfile modelfile exportfile


                                  If you have a large number of projects to process, then there may be better ways to do this kind of work, but this approach will fundamentally work.

                                    • automating project export
                                      whathetin _

                                      Hi. I am trying to write a batch file that opens a project and exports to excel.


                                      My batch file says:



                                      I thought this would open the projects but its only opening the monarch application. I have version 6.  What am I doing wrong?

                                        • automating project export
                                          Olly Bond

                                          Hello Whathetin,


                                          Your batch file just relies on Windows to know what to do with a .prj file and that's why it opens it in Monarch. To tell Monarch to open the project and perform the exports, you'll need three bits of information, all in one line:


                                          "C:\Program Files\Monarch\Program\Monarch.exe" "P:\APPS\MONARCH\PROGRAM\MONARCH\Projects-LA\GABV-PROJ.prj" /pxall[/CODE]


                                          The first part tells Windows to run Monarch, the second tells Monarch to open the .prj file, and the third "/pxall" part tells Monarch to perform all the project exports defined in the project.


                                          (edit) Just read the rest of the thread - to find out the path to the Monarch executable, you should right click on the shortcut to Monarch and look at the Properties. This should help you get the first of the three parts of the batch file right.


                                          Best wishes,