View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default communication with MS Project

If a block of code protected by an IF statement is not executed, the obvious
cause is that the condition specified in the If statement is not passed. I
would begin debugging by figuring out what the value of Check_TP_A is
before you hit the IF statement and make sure it is being defined correctly
and so forth.

--
Regards,
Tom Ogilvy


"Anne" wrote in message
...
Hi,

I have an application in Excel which communicates with MS
Project. The syntax might be correct (no error message),
but it is not executed. I cannot imagine why and I find no
hint in the object catalogue.
My code:

Dim Projekt As Object
' start Project
Set Projekt = CreateObject("MSProject.Project")
Projekt.Application.FileOpen newTimeSchedule

'*****this is the part which is not executed
If Check_TP_A.Value = False Then 'CheckBox
Projekt.Application.SelectTaskField Row:=0,
Column:="Name"
Projekt.Application.SetTaskField Field:="%
Abgeschlossen", Value:="100", AllSelectedTasks:=True
End If
'*****
Projekt.Application.FileClose pjSave
'Close MSProject
Projekt.Application.Quit pjDoNotSave

Thanks for every hint!

Anne