1 Reply Latest reply on Sep 14, 2018 6:58 AM by T.Schmitt

    Using the DataLink "explore events"-function  via vba

    T.Schmitt

      Hi there,

      i'm trying to get events from an AF Server using vba, but it does not work.When i try

       

      .Range("A1:F3").Value = Application.Run("PIEFDAT", strPIServer, StartDate,EndDate, 0, "*", strTemplate, "*", "*", "*", "", "", "active in range", "start time ascending", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{EN},{ST},{ET},{DU},{EFT},{PE}", "", "", 0, 0)

       

      in my code, i get an error message: 'Wrong number of arguments or invalid property assignments'.  I don't know how to correctly use the PIEFDat-function in vba.

      Can anybody help?

       

      Thanks in advance!

      Torsten

       

      Edit:

      Ok, now i know that the application.run - method is only able to deal with a maximum of 30 arguments.

      But the PIEFDat-function needs 34 input parameters in total.

      Is there another way to call the PIEFDat-function in vba?

        • Re: Using the DataLink "explore events"-function  via vba
          T.Schmitt

          Problem solved:

          I used the FormulaArray property instead of application.run. (FormulaArray uses the r1c1-notation for cells)

           

          Range("A5:F100").FormulaArray = _

                  "=PIEFDat(""\\PIMSAF\Chemie"",R1C1,R2C1,0,""*"",R3C1,""*"",""*"",""*"","""","""",""active in range"",""start time ascending"","""","""","""","""","""","""","""","""","""","""","""","""","""","""","""",""{EN},{ST},{ET},{DU},{EFT},{PE}"","""","""",0,0)"

          3 of 3 people found this helpful