Having a problem with Geopak GetJobNumbersWithinAcdtiveDir

I have one VBA that will not find the gpk file. Using the same code that works on the other VBA. Below is the code from the example which is used to check. The result returns the path/jobjob104.gpk

 Dim jobNums()   As String
    Dim count       As Integer
    Dim myCogo      As Cogo

    'Array of Job Numbers
    jobNums() = GetJobNumbersWithinActiveDir()

    For count = LBound(jobNums) To UBound(jobNums)
        'Get the first Job Number in the array
        If 0 = count Then
            'Set the active Job Number
            Set myCogo = OpenCogoByJobNumber(104)
            'Set myCogo = OpenCogoByJobNumber(jobNums(count))

            If (myCogo Is Nothing) Then
                MsgBox "error reading job: " & jobNums(count)
            Else
                MsgBox myCogo.FullFileName
            End If

        End If

    Next count

Parents
  • Hi Larry,

    Do you receive any error message? Or which indicator do you have the .gpk file is not found?

    Two points are crossing my mind:
    - this example is assuming the lower boundary of the array jobNums is 0.
    In case the Compiler Option Base 1 is used, the lower boundary will be 1 and the desired job not found.
    Can you please check in your source code, if you can find a line with:
    Option Base 1

    - Did you check if the .gpk file is located in the right folder. To be sure please compare the file location with the content of the configuration variable _dgndir

    Best regards,
    Artur

Reply
  • Hi Larry,

    Do you receive any error message? Or which indicator do you have the .gpk file is not found?

    Two points are crossing my mind:
    - this example is assuming the lower boundary of the array jobNums is 0.
    In case the Compiler Option Base 1 is used, the lower boundary will be 1 and the desired job not found.
    Can you please check in your source code, if you can find a line with:
    Option Base 1

    - Did you check if the .gpk file is located in the right folder. To be sure please compare the file location with the content of the configuration variable _dgndir

    Best regards,
    Artur

Children