4 Replies Latest reply: May 15, 2014 9:55 AM by RalphB _ RSS

    Run-time Error

    DY*BIM _

      Hi,

       

      When running Monarch (V7 Pro) via Access, I get the following error message:

       

      Run-time error '-2147417851 (80010105)':

       

      Automation error

      The server threw an exception.

       

      When I choose debug and in the VB code, the error program is paused in this section: (paused @ ***)

       

      [font="courier"] 

          'open the claimrun files.  it will cycle through the files and load all avaiable CR* records

          strPath = "S:SharedClaimsEpic"

          strFile = Dir(strPath & "cr*")

          Do While strFile <> ""

            

          • blnOpenFile = objMonarch.SetReportfile(strPath & strFile, True)

              If blnOpenFile = False Then

                  MsgBox "Error Opening File: " & strFile

                  Exit Sub

              End If

              strFile = Dir()

          Loop[/font][/quote]When pressing F5 in the code, the routine runs as it should...

       

      It worked yesterday.  Last night Office 2000 SP3 was installed on this PC.

       

      Help...

       

      TIA,

       

      dy

        • Run-time Error
          Rormeister _

          When I test your code it only reads the first matching file. 

           

          In later versions of VBA proper syntax is more critical. In VBA Help:

           

          "To iterate over all files in a folder, specify an empty string: Dir("")

           

          Hope this helps.

          • Run-time Error
            Nick Osdale-Popa

            Originally posted by Rormeister:

            When I test your code it only reads the first matching file. 

             

            In later versions of VBA proper syntax is more critical. In VBA Help:

             

            "To iterate over all files in a folder, specify an empty string: Dir("")

             

            Hope this helps. /b[/quote]Good to know. Still stuck in the '90s here, so once (if) we upgrade, I'll have to keep that in mind.

            • Run-time Error
              DY*BIM _

              Thank for the input.  The problem was that as I was testing the process, the object will not always close properly...it self corrected as my testing span across the whole process versus selected stages.  It is working fine in production.

               

              The Dir() is working with application, but I will test the Dir("") version of the code.

               

              Thanks,

               

              dy

              • Run-time Error
                RalphB _

                I am running Windows 2000 with sp 4 and when I changed the Dir() to Dir("") in my Excel 2000 macros, it started to look for a file in "My Documents" folder , not the directory where I was searching.  :confused:   No matter how many times I stepped thru it, it stayed on the same file name - never changed file names.