2 Replies Latest reply: May 15, 2014 9:55 AM by Jose _ RSS

    Scripting: processing multiple models and exports

    Maxer _

      Is there a way I can open say 10 reports, and their models, and then generate 10 exported excel files WITHOUT having it close Monarch each time?

       

      So far I have to have the script open Monarch, then it does the report, model, exports and THEN it closes Monarch.

       

      Then the next file has to open it again, is there some way to keep Monarch open until the ENTIRE script finishes?

       

      Thank you.

        • Scripting: processing multiple models and exports
          Nick Osdale-Popa

          Are you using the command line (batch) or VBA programming?

           

           

          VBA (roughly):

           

          [font="courier"]Set mapMonarch = CreateObject("Monarch32")

          With mapMonarch

            OpenFile = .SetReportFile("ReportFile1", False)

            OpenModel = .SetModelFile("Model1")

            .JetExportTable("ExportFile", "Sheet1", 1)

            .CloseAllDocuments

            OpenFile = .SetReportFile("ReportFile2", False)

            OpenModel = .SetModelFile("Model2")

            .JetExportTable("ExportFile", "Sheet2", 1)

            (etc)

          End With[/font][/quote]

          • Scripting: processing multiple models and exports
            Jose _

            Hi Maxer, just reading your script at the moment and I am interest in how you get automatic exports.  Are these exports summaries?

             

            I am currently using .BAT files to run Monarch automation is this how you are running them?