6 Replies Latest reply: May 15, 2014 9:56 AM by Ontiveros _ RSS

    Auto running Monarch

    Ontiveros _

      I used to use the following to auto-run Monarch in a MS Access program but after updating to v8, it no longer works, any ideas why?:

       

      Private Sub cmdImportDailyRecords_Click()

       

          Dim MonarchObj As Object

          Set MonarchObj = CreateObject("Monarch32")

          MonarchObj.SetProjectFile ("C:Documents and SettingsDOntiverosDesktopDaniATM806.prj")

          MonarchObj.ExportTable ("C:Documents and SettingsDOntiverosDesktopDaniATM806.xls")

          MonarchObj.CloseAllDocuments

          MonarchObj.SetProjectFile ("C:Documents and SettingsDOntiverosDesktopDaniCIS.prj")

          MonarchObj.ExportTable ("C:Documents and SettingsDOntiverosDesktopDaniCIS.xls")

          MonarchObj.CloseAllDocuments

          MonarchObj.SetProjectFile ("C:Documents and SettingsDOntiverosDesktopDaniDCM.prj")

          MonarchObj.ExportTable ("C:Documents and SettingsDOntiverosDesktopDaniDCM.xls")

          MonarchObj.CloseAllDocuments

          MonarchObj.Exit

          Set MonarchObj = Nothing

       

      End Sub

        • Auto running Monarch
          Grant Perkins

          Possibly a number of reasons but I notice that you are using .prj files and V8 will be expecting .xprj files.

           

          Could this be the problem?

           

          If you have any processes using .mod files you could have the same problem.

           

          I presume you have considered the conversion utility and done whatever is necessary there but perhaps not for you programs and scripts?

           

          I could be wrong of course! Programming and automation are not strong points in my knowledge.

           

           

          Grant

          • Auto running Monarch
            Ontiveros _

            I changed it to .xprj in the code but the same thing happens, the manoarch pro screen briefly appears and disappears but nothing exports.

            • Auto running Monarch
              Grant Perkins

              OK. Basic questions to make sure we are covering the simple issues.

               

              Do the .xprj files the code now refers to actually exist?

               

              Have you run the V8 Utility program to convert prj and mod files to xprj and xmod?

               

              Alternatively have you opened the models/projects that were originally text files and saved them using V8 (which will convert them to XML files anyway).

               

              If the answers to that are all positive I suppose the next steps would be to double check the permissions for the folders referenced, the Monarch files referenced and the registry entries created as part of the installation.

               

              Also whether there are any new developments that might affect the way the code works so it might be worth checking the latest programmers guide from the Datawatch web site.

               

              It may also be worth considering using the Hidden settings (see "Settings" in the help file) to see of logging the operations provides any information but it may not be of much use to you here.

               

              If none of these suggestions get you anywhere I am sure one of the automation power users will come up with the answer!

              • Auto running Monarch
                Ontiveros _

                The models were converted to xmod's and the projects have now been saved as xprj's.  I am now getting a Runtime Error 429: ActiveX component can't create object. Maybe a .dll isn't registered.

                • Auto running Monarch
                  Ontiveros _

                  My mistake, sorry.  I removed the 32 from the CreateObject("Monarch32") line. I have just replaced it but what seems to be happening again is the initial Monarch screen appears then disappears without running the project.

                  • Auto running Monarch
                    Ontiveros _

                    I was looking through the code and realized that the location had been renamed.  My error.