10 Replies Latest reply: May 15, 2014 9:55 AM by cardealers _ RSS

    V6 batch script for a project

    cardealers _

      Hi,

       

      I just came back from a Monarch beginners class, I know this just make me dangerous, but one of the things the instructor showed was batching of projects. I am trying to batch 15 projects and output each project to a seperate sheet inside an Excel workbook.

       

      I have the below and it's not working, granted it is just one project at this time.  I will be adding to it when I get this first project working.

       

       

      c:

      cdprogram filesmonarchpublish

      ..monarchmonarch.exe publishDSRC_Bo_Hammond.prj      est.xls /T

       

       

      As always, any help is greatly appreciated.

       

      Cardealers

        • V6 batch script for a project
          Steve Caiels

          Hi Paul,

           

          Taking a Monarch Training Class moves you into a higher level of existence.

           

          If there are any European readers who wish to join this elite group, please drop me an email  

           

          Try

          [font="courier"]c:

          cd "program filesmonarch"

           

          programmonarch "publishDSRC_Bo_Hammond.prj" test.xls /T[/font][/quote]Then just keep repeating the last line for each project.

          Cheers

          Steve

           

          [size="1"][ January 12, 2004, 11:31 AM: Message edited by: Steve Caiels ][/size]

          • V6 batch script for a project
            cardealers _

            Steve,

             

            Thanks for the info, I guess I should have mentioned I am on Win2000.  Don't know if that makes a difference.

             

            I took your code and modified it to look like this:

            -


            c:

            cd "program filesmonarch"

            publishDSRC_Bo_Hammond.prj test.xls /T

            -


            programmonarch was giving me an error.

             

            The only issue with my change is it takes me into Monarch executes the model associated with the project and stops while inside Monarch.

             

             

            Any more ideas?

             

            Cardealers

            • V6 batch script for a project
              Grant Perkins

              IIRC with Win 2000 you still need to " QUOTE " long file names and so on.

               

              "publishDSRC_Bo_Hammond.prj"

               

              may be the answer.

               

              Grant

               

              Originally posted by cardealers:

              Steve,

               

              Thanks for the info, I guess I should have mentioned I am on Win2000.  Don't know if that makes a difference.

               

              I took your code and modified it to look like this:

              -


              c:

              cd "program filesmonarch"

              publishDSRC_Bo_Hammond.prj test.xls /T

              -


              programmonarch was giving me an error.

               

              The only issue with my change is it takes me into Monarch executes the model associated with the project and stops while inside Monarch.

               

               

              Any more ideas?

               

              Cardealers /b[/quote]

              • V6 batch script for a project
                Steve Caiels

                Hi Paul,

                 

                Are you using a network version of Monarch?  If so, then you need to point to the Monarch.exe on the server.  You should be able to look at the properties for any shortcut or menu choice you have to see where it is.

                 

                Assuming your network Monarch is on an s: drive in a folder called apps, your batch file will be

                 

                "s:appsmonarchprogrammonarch"[/b] "publishDSRC_Bo_Hammond.prj"      est.xls /T

                 

                Just replace the bold bit with your real path to Monarch and it should be OK.

                 

                Cheers

                Steve

                • V6 batch script for a project
                  cardealers _

                  Steve,

                   

                  Thanks for the answer, but with that code I get 2 instances of Monarch.  One from the first line that just opens Monarch and sits there.  When I 'x' out of this instance, the second line opens another instance of Monarch.  This instance loads my project and executes the associated template and then sits there.  No .xls file is created and I have to 'x' out of Monarch.

                  • V6 batch script for a project
                    Steve Caiels

                    Hi Paul,

                     

                    All 4 parts (including the /t) need to be on the same line.

                     

                    If you already have them on one line, then the only thing I can think of is that your network version has been modified to run from a batch file.  Please check that the properties from the icon that you copied point to monarch.exe.

                     

                    Cheers

                    Steve

                    • V6 batch script for a project
                      cardealers _

                      Hi all,

                       

                      I have the batch file finally working.  Thanks for the help.

                       

                      Yet another questions.  I set up the batch file to execute 20 project and they are suppose to add a new worksheet to the excel workbook.  Instead each project is overwriting the previous project.

                       

                      Is there another switch I need to pass?

                       

                      There's a subset of my batch file:

                       

                      "h:programmonarch.exe" "g:Monarch Model TemplatesDSRC_Bo_Hammond.prj" c:pjrtest.xls /t

                      "h:programmonarch.exe" "g:Monarch Model TemplatesDSRC_Chad_Eddlemon.prj" c:pjrtest.xls /t

                      "h:programmonarch.exe" "g:Monarch Model TemplatesDSRC_Cole_Price.prj" c:pjrtest.xls /t

                      "h:programmonarch.exe" "g:Monarch Model TemplatesDSRC_David_Riker_Area.prj" c:pjrtest.xls /

                      • V6 batch script for a project
                        Steve Caiels

                        Hi Paul,

                         

                        You can't do that in a batch file unless you use the new Project Export feature of V7 Professional. 

                         

                        If you have that version, then you can set up the projects to either create a new workbook, overwrite or append to an existing sheet, or add a new sheet.  So the usual plan would be to get your first project to create a new workbook, overwriting the old one if it exists, then each subsequent project would add a new sheet.

                         

                        If all your projects are using the same report file and model, but with different filters or summaries active, then you can do it all this with one project using V7 Pro.

                         

                        Your complete batch file line would then be

                         

                        "h:programmonarch.exe" "g:Monarch Model TemplatesDSRC_Everyone.prj" /pxall

                         

                        All on one line again.  You’ll see that the xls file name is not needed as it is specified in the V7 project export.  And the /PXall means export all jobs

                         

                        So I highly recommend an update if you don’t already have it.

                         

                        Another option is to write an application in something like vba.  That is not my forte I’m afraid, but you can download the programmers guide from  [url="http://www.datawatch.com/vortexmlsupport/downloads.htm."]http://www.datawatch.com/vortexmlsupport/downloads.htm.[/url]

                         

                        Regards

                        Steve

                         

                        [size="1"][ January 16, 2004, 09:05 AM: Message edited by: Steve Caiels ][/size]

                        • V6 batch script for a project
                          Grant Perkins

                          Paul,

                           

                          I would support Steve's suggestion of an upgrade to V7 if you can. It would open up many possibilities for you by the sound of your description.

                           

                          If not possible have you considered expporting each worksheet separately and then simply including them in a single workbook by some form of Excel macro? I assume this would be possible in most versions of Excel since some way back,

                           

                          Nick Osdale-Popa might be a good person to ask for any vba routines if you need to go that route though there are a number of experienced Excel users posting on the forum who may have something to suggest.

                           

                          That said, the upgrade might be the most cost effective way forward, depending on your current circumstances.

                           

                          Grant

                           

                          Originally posted by cardealers:

                          Yet another questions.  I set up the batch file to execute 20 project and they are suppose to add a new worksheet to the excel workbook.  Instead each project is overwriting the previous project.

                           

                          /b[/quote]

                          • V6 batch script for a project
                            cardealers _

                            Steve and Grant,

                             

                            Thanks for ammo.  I have been asking managment to upgrade and will submit your answers to them.

                             

                            Cardealers