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 Reply Children
  • Prior to requiring computer specific logging to be performed, I would recommend these actions:

    1. Import your MicroStation VBA project source code files into a new project.  Doing so will ensure there is no underlying Microsoft VBA project corruptions.  Right click on each module, class, and form exporting each as a separate source code file that can be imported into a new/clean MicroStation VBA project container.
    2. Trap errors and Compile the MicroStation VBA Project.  The default Microsoft VBA programming environment options are tuned more towards providing less user feedback/interruptions and have the unfortunate side-effect of masking/hiding errors that programmers should be aware of.  In your Microsoft VBA development environment (not for production users) start by using the following Microsoft VBA project settings, then compile your VBA project:

    • Tools > Options > Editor Tab > Code Settings, Check: "Require Variable Declaration"
    • Tools > Options > General Tab > Error Trapping, Check: "Break on Unhandled Errors"
    • Tools > Options > General Tab > Compile:
      • Check: "Compile On Demand"
      • Check: "Background Compile"
    • Debug > Compile <your project name>
    • Provide a small concise test case (minimal data and code) required for others willing to help to be able to reproduce the exact issue being experienced.  This will result in vastly improved times to resolution of issues being encountered and is analogous to a picture being worth a thousand words.

    • Change or perform only one item at a time and report back exact results experienced.
      REFERENCE: David Agans - http://debuggingrules.com/ (DebuggingRules.jpg)

    HTH,
    Bob



  • Bob,
    Sorry it took so long to back to you, the work and deadline got in the way. I did deconstruct the vba and rebuild it. And it does work correctly now.

    Larry Wilson
    LWilson@LJBinc.com
     

    Answer Verified By: Beebe Ray