1 Reply Latest reply: May 15, 2014 9:53 AM by RalphB _ RSS

    JetExportSummary for Monarch Pro v8.0

    Jeff O

      I have no formal VB training, and am attempting a VB script in Excel to export a summary table.  I keep getting a syntax error on the JetExportSummary line.  I am using the below code.  Can anyone tell me what I am doing wrong?  Thanks!

       

      Sub Form_Load()

      Dim MonarchObj As Object

      Dim openfile, openmod, t As Boolean

      Set MonarchObj = GetObject("", "Monarch32")

       

      If MonarchObj Is Nothing Then

          Set MonarchObj = CreateObject("Monarch32")

      End If

       

      t = MonarchObj.SetLogFile("H:MonarchMPrg_G5.log", False)

       

      openfile = MonarchObj.SetReportFile("J:FinanceMonarch ReportsReportsIT73IT73070203-#110.prn", False)

       

      If openfile = True Then

          openmod = MonarchObj.SetModelFile("H:MonarchModelsIT73.xmod")

           

          If openmod = True Then

              MonarchObj.currentsummary = "Total Amount"

              MonarchObj.jetexportsummary ("H:MonarchExports     est1.xls", "test", 0)

          End If

       

      End If

       

      MonarchObj.CloseAllDocuments

      MonarchObj.Exit

      End Sub

        • JetExportSummary for Monarch Pro v8.0
          RalphB _

          Welcome to the forum Jeff,

           

          There are several of us that use VB to script our Monarch exports so you will find a lot of help here.  I know I did when I started scripting Monarch.

           

          The JetExportSummary method returns a boolean value so try using something like:

          expfile =MonarchObj.jetexportsummary ("H:MonarchExports     est1.xls", "test", 0).

           

          Try that and you should be good to go.

           

          Once you get a few scripts under your belt, you will find how versatile that tool is and how much time it can save.

           

          HTH

           

          Ralph