Project98 OLE & VB: bugs, bugs, bugs 
Author Message
 Project98 OLE & VB: bugs, bugs, bugs

First, I'm running:

NTWKS 4.0sp3
VB5sp3
Project98

I'm trying to create a simple VB application which opens a Project98 project
and lists info on the tasks in it.  It goes like this:

Dim strProjectFile As String

Private Sub Form_Activate()
    Dim tskTask As Task
    Dim pjProject As Project
    Dim i As Integer
    Dim strPhase As String
    Dim strOwner As String

    Call FileOpen(Name:=strProjectFile, ReadOnly:=True, Merge:=pjDoNotMerge,
openPool:=pjDoNotOpenPool)

    appCount = Application.Projects.Count
    For i = 1 To appCount
        If Application.Projects(i).Path & "\" & Application.Projects(i).Name
& ".mpp" = strProjectFile Then
            Set pjProject = Application.Projects(i)
            Exit For
        End If
    Next i

    For i = 1 To pjProject.Tasks.Count
        Set tskTask = pjProject.Tasks(i)
        If Len(tskTask.OutlineNumber) = 1 Then
            strPhase = tskTask.Name
        End If
        If Len(tskTask.OutlineNumber) = 3 Then
            strOwner = tskTask.Name
        End If
        If Len(tskTask.OutlineNumber) = 5 Then
            Debug.Print tskTask.Name & ", owner " & strOwner & ", phase " &
strPhase
        End If
    Next i

End Sub

Private Sub Form_Initialize()
    If UBound(Args) < 1 Then
        strProjectFile = "C:\WINNT\Profiles\elis\Desktop\Master_Project.mpp"
    Else
        strProjectFile = Args(0)
    End If
End Sub

The only reason there's code in the Form_Activate is I thought there was
something about it being in _Initialize that might be causing the problem...
the problem being that when I try to run this, it crashes VB.  Sometimes.
In different places each time.

Please, I need a solution for this quickly.  Has anyone else run into this
sort of problem?  Any insights?

Thanks!

Eli Smith
developer, fine.com interactive

206.292.2888x136



Fri, 14 Jul 2000 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. IDE BUGs, BUGs, BUGs....

2. BUGS BUGS BUGS!

3. VB 4.0 16-bit Bug with OLE (Was Re: VB 4.0 Enterprise and OLE)

4. My Bug or VB.Net Bug ???

5. BUG BUG in VB

6. BUG BUG in VB

7. Stange String Behavior - Bug or Bugged ?

8. Anti-Bug If/Then Makes a Bug

9. BUG: Workaround for cool menu accelerator bug?

10. Bug.. VBScript ASP Dictionary Bug

11. BUG, VERY BIG BUG IN VB5

12. BUG, VERY BIG BUG in VB5

 

 
Powered by phpBB® Forum Software