4 Replies Latest reply: May 15, 2014 9:58 AM by Stephen Reid RSS

    Exporting to Excel

    RonP _

      Hi all


      I am using VBA to export from Mararch 6.0 when I try to import the Excel file to Access XP I get a message stating that the file is not the right format. It seem that the file is being exported as Excel 2.0 format. I have Monarch set to export as Excel 8.0. Can you help me below is the code I am using:


      Private Sub cmdBatch_Click()

      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("C:MonTempMPrg_G5.log", False)


      OpenFile = MonarchObj.SetReportFile("y:kls_kmw3270phuphutoday", False)


      If OpenFile = True Then

          openmod = MonarchObj.SetModelFile("y:kls_kmwMonarchModPick Detail Holdup Model W.mod")


          If openmod = True Then

              MonarchObj.CurrentFilter = "Div"

          MonarchObj.ExportTable ("Y:kls_kmwexcelholdupsDailyHU.xls")

          End If

      End If




      End Sub




        • Exporting to Excel
          Winn _



              There is nothing that you can do about this. If you look up the ExportTable or ExportSummary functions in the  Monarch Programmers Guide[/b], it states that, "The export file type is limited to the Monarch V3 capabilities and determined by the file extension specified for  export file[/i] ...". The version of Excel supported by Monarch v3 is version 2.1.

              You can try saving the Excel spreadsheet to a higher version after Monarch has exported to it and before importing to Access.  That may resolve your problem.

              Hope that helps.

          • Exporting to Excel
            RonP _

            Thanks for the info, No that did not help either. For some reason there are about 2 thirds of the records do not get imported, only the records that have data in one of the fields. Not sure why. I guess I will still have to use the autoscrip and batch files.

            • Exporting to Excel
              Gareth Horton



              Take a look at this thread.


              [url="http://mails.datawatch.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=1;t=000015#000003"]Monarch 6 Pro Automation[/url]


              [size="1"][ May 01, 2006, 05:40 PM: Message edited by: Todd Niemi ][/size]

              • Exporting to Excel
                Stephen Reid

                I dont know if this helps but if you have professional version of monarch then you can use the jet export table command as opposed to the export table command.  This allows you to export to newer versions.