S
SteDal
TASK: I am updating RemainingDuration and other fields on a Schedule and is
capturing the resulting scheduling changes. For each set of changes, I need
to Undo the changes so that the first set of changes do not interfere with
the second set of changes, and so on. I therefore need VBA to do an UnDo
after each set of changes. The following is a simplified version based on
the example on Page 441 in Rod Gill’s excellent book:
Sub TestUndo()
Application.OpenUndoTransaction "Test"
ActiveProject.Tasks.Add "New Task"
Application.CloseUndoTransaction
Application.Undo 1
End Sub
The 'Application.Undo 1' statement creates R-t error 1100: 'This method is
not available in this situation.'
I tried replacing it with “EditUndo†and get the same error.
The only way I see out of this is placing the VBA in Excel, and closing
Project without Saving, then opening again (Application.FileOpenEx) for the
next round of tests. Not an elegant solution. As the code must also work with
Project Server, I must find the logon details and pass on to
Application.FileOpenEx.
I hope someone out there can propose a better solution, ?
capturing the resulting scheduling changes. For each set of changes, I need
to Undo the changes so that the first set of changes do not interfere with
the second set of changes, and so on. I therefore need VBA to do an UnDo
after each set of changes. The following is a simplified version based on
the example on Page 441 in Rod Gill’s excellent book:
Sub TestUndo()
Application.OpenUndoTransaction "Test"
ActiveProject.Tasks.Add "New Task"
Application.CloseUndoTransaction
Application.Undo 1
End Sub
The 'Application.Undo 1' statement creates R-t error 1100: 'This method is
not available in this situation.'
I tried replacing it with “EditUndo†and get the same error.
The only way I see out of this is placing the VBA in Excel, and closing
Project without Saving, then opening again (Application.FileOpenEx) for the
next round of tests. Not an elegant solution. As the code must also work with
Project Server, I must find the logon details and pass on to
Application.FileOpenEx.
I hope someone out there can propose a better solution, ?