Is it possible to change the settings in the MS Project options menu from vba? If so, how?

StackOverflow https://stackoverflow.com/questions/20099204

  •  03-08-2022
  •  | 
  •  

Pregunta

I am specifically trying to change:

file > options > Schedule > Scheduling options for this project > Split in-progress tasks

I have written a macro which changes the 'Stop' field, but if this box is not checked then the 'stop' field becomes read only.

I have not found any examples of someone trying this in other forums.

I am working in Project 2010

¿Fue útil?

Solución

With a bit of persistence in searching, I have found the answer. It is actually in the object browser in Project 2013, but I didn't see it in the Project Model on MSDN.

So, here is a simple toggle macro for the original question and for my question (but same solution really).

I know there is a way to write a toggle more succinctly, but apart from the fact that I cannot remember how, this also shows the logic better.

Hope this helps!

Nic.

Sub ToggleAutoLink()

    Dim ap As Project
    Set ap = ActiveProject

    If ap.AutoLinkTasks = True Then
        ap.AutoLinkTasks = False
    Else
        ap.AutoLinkTasks = True
    End If

End Sub

---------------

Sub ToggleSplitInProgess()

    Dim ap As Project
    Set ap = ActiveProject

    If ap.AutoSplitTasks = True Then
        ap.AutoSplitTasks = False
    Else
        ap.AutoSplitTasks = True
    End If

End Sub

Otros consejos

I have been looking for something very similar, but sadly I cannot answer as I have also not found a way, and came across this thread while googling for an answer.

I want to toggle an option very near yours (!), and that is the "Autolink inserted or moved tasks" and I had hoped I could write something simple in VBA and have a button on my Quick Access toolbar.

So...this is just a small attempt to Bump this question.

Nic.

MS Project 2013 Professional

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top