V
Verossa
Hi All
I have tried to input Gerards macro for exporting resource by project into MS Excel and am recieving the following error:
Run-time error '91':
Object variable or With block variable not set
When I debug the error it highlights the following line:
If oTache.Parent = "Microsoft Project" Then
Is there something unique in my local setup that is causing this error?
TIA to anyone who can help - Vers
Here's the code Gerard forwarded:
Sub Tache_Projet()
Dim oTache As Object, NomProj As String
For Each oTache In ActiveProject.Tasks
If Not oTache Is Nothing Then
oTache.Text10 = oTache.Name 'Copie de sécurité...
If oTache.Flag1 = False Then 'pour ne pas insérer le nom 2 fois
If oTache.Parent = "Microsoft Project" Then
NomProj = oTache.Name
GoTo Suite
End If
If oTache.Parent.Parent = "Microsoft Project" Then
NomProj = Left(oTache.Parent.Name, Len(oTache.Parent.Name) - 4)
GoTo Suite
End If
If oTache.Parent.Parent.Parent = "Microsoft Project" Then
NomProj = Left(oTache.Parent.Parent.Name, Len(oTache.Parent.Parent.Name) - 4)
GoTo Suite
End If
Suite:
oTache.Name = NomProj & " " & oTache.Name
oTache.Flag1 = True
End If
End If
Next
End Sub
I have tried to input Gerards macro for exporting resource by project into MS Excel and am recieving the following error:
Run-time error '91':
Object variable or With block variable not set
When I debug the error it highlights the following line:
If oTache.Parent = "Microsoft Project" Then
Is there something unique in my local setup that is causing this error?
TIA to anyone who can help - Vers
Here's the code Gerard forwarded:
Sub Tache_Projet()
Dim oTache As Object, NomProj As String
For Each oTache In ActiveProject.Tasks
If Not oTache Is Nothing Then
oTache.Text10 = oTache.Name 'Copie de sécurité...
If oTache.Flag1 = False Then 'pour ne pas insérer le nom 2 fois
If oTache.Parent = "Microsoft Project" Then
NomProj = oTache.Name
GoTo Suite
End If
If oTache.Parent.Parent = "Microsoft Project" Then
NomProj = Left(oTache.Parent.Name, Len(oTache.Parent.Name) - 4)
GoTo Suite
End If
If oTache.Parent.Parent.Parent = "Microsoft Project" Then
NomProj = Left(oTache.Parent.Parent.Name, Len(oTache.Parent.Parent.Name) - 4)
GoTo Suite
End If
Suite:
oTache.Name = NomProj & " " & oTache.Name
oTache.Flag1 = True
End If
End If
Next
End Sub