3 Replies Latest reply: May 15, 2014 9:51 AM by Gareth Horton RSS

    JetExportSummary Monarch Pro vs Reg Monarch

    JoeB _

      I have created an Excel model that uses the following sub to open two report files apply a Monarch Model and export the summary to an Excel file. 

       

      Sub GLExport()

        Dim MonarchObj As Object

        Dim openfile, t, exportfile As Boolean

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

            If MonarchObj Is Nothing Then

              Set MonarchObj = CreateObject("Monarch32")

            End If

         t = MonarchObj.SetLogFile(ThisWorkbook.Path  

             & "MPrg_G5.log", False)

        openfile = MonarchObj.SetReportFil         

          (ThisWorkbook.Path & "GL.SPL", False)

        openfile = MonarchObj.SetModelFile

          (ThisWorkbook.Path & "GLPayroll.mod")

        exportfile = MonarchObj.JetExportSummary

          (ThisWorkbook.Path

          & "Transfer.xls", "GLData", 0)

        MonarchObj.Exit

      End Sub

       

       

      The Excel model works fine using this exact code on my machine running windows XP, Excel 2002 and MonarchPro 7.01.  However, when I tried to run the same model on another machine with Windows 2000, Excel 2003 and Regular Monarch  7.01 the above sub would get hung up on the this line.  

       

      exportfile = MonarchObj.JetExportSummary(ThisWorkbook.Path & "Transfer.xls", "GLData", 0)

       

      Is it because the second machine is not running Monarch Pro?  I thought the only difference between Monarch and Monarch Pro was that with Pro you could establish an ODBC connection and run queries directly from the database.  Does JetExportSummary not work with the regular version of Monarch or is there something else that I am missing?

       

      Any help would be greatly appreciated.

       

      Joe

        • JetExportSummary Monarch Pro vs Reg Monarch
          Nick Osdale-Popa

          [b]Originally posted by JoeB:

          Is it because the second machine is not running Monarch Pro?  I thought the only difference between Monarch and Monarch Pro was that with Pro you could establish an ODBC connection and run queries directly from the database.  Does JetExportSummary not work with the regular version of Monarch or is there something else that I am missing?

           

          Any help would be greatly appreciated.

           

          Joe[/b][/quote]JetExportTable/Summary works just fine in Regular Versions.  I copied your code into Excel 97 (SR-2) (fixed a typing mistake @ openfile = MonarchObj.SetReportFil[b][i]e[/i][/b](ThisWorkbook.Path & "GL.SPL", False)) and found no fault with it. I'm at a loss as to why it's failing on that line.

          The best I can think of is to make sure you are up to date on the Service Packs with W2k (SP3 corrected a lot of errors) and the latest Jet Service Packs.

          • JetExportSummary Monarch Pro vs Reg Monarch
            JoeB _

            I tried running my Excel model with the above sub on five different machines three that had Monarch Pro and two that had the regular version of Monarch.  The machines with the Pro version all worked fine.  The two with the regular version would get hung up on the JetExportSummary line.  I took Nick’s advice and updated the Windows service packs on the two machines with regular versions of Monarch but that did not solve the problem.  It was not until I upgraded those two machines to Monarch Pro that the Excel model would run and the above sub would not get hung up on the JetExportSummary line.

             

            I can not explain why Nick was able to get the sub to run on the regular version of Monarch and I was not.  I do know that there is something different between the Pro and Regular versions of Monarch other than the ability to connect directly to a database.

            • JetExportSummary Monarch Pro vs Reg Monarch
              Gareth Horton

              Joe

               

              I'm afraid only Monarch Pro 6 and higher supports the JetExportTable and JetExportSummary methods.

               

              This information is listed in the  [url="http://www.datawatch.com/pdf/products/monarch/Monarch_6_Programmers_Guide.pdf"]Monarch Programmers Guide[/url]  under 'Properties and Methods by' Version

               

              Gareth

               

               

              Originally posted by JoeB:

              I have created an Excel model that uses the following sub to open two report files apply a Monarch Model and export the summary to an Excel file. 

               

              Sub GLExport()

                Dim MonarchObj As Object

                Dim openfile, t, exportfile As Boolean

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

                    If MonarchObj Is Nothing Then

                      Set MonarchObj = CreateObject("Monarch32")

                    End If

                 t = MonarchObj.SetLogFile(ThisWorkbook.Path  

                     & "MPrg_G5.log", False)

                openfile = MonarchObj.SetReportFil         

                  (ThisWorkbook.Path & "GL.SPL", False)

                openfile = MonarchObj.SetModelFile

                  (ThisWorkbook.Path & "GLPayroll.mod")

                exportfile = MonarchObj.JetExportSummary

                  (ThisWorkbook.Path

                  & "Transfer.xls", "GLData", 0)

                MonarchObj.Exit

              End Sub

               

               

              The Excel model works fine using this exact code on my machine running windows XP, Excel 2002 and MonarchPro 7.01.  However, when I tried to run the same model on another machine with Windows 2000, Excel 2003 and Regular Monarch  7.01 the above sub would get hung up on the this line.  

               

              exportfile = MonarchObj.JetExportSummary(ThisWorkbook.Path & "Transfer.xls", "GLData", 0)

               

              Is it because the second machine is not running Monarch Pro?  I thought the only difference between Monarch and Monarch Pro was that with Pro you could establish an ODBC connection and run queries directly from the database.  Does JetExportSummary not work with the regular version of Monarch or is there something else that I am missing?

               

              Any help would be greatly appreciated.

               

              Joe /b[/quote]