Home > Software design >  Excel to MS Project via VBA SetTaskMode
Excel to MS Project via VBA SetTaskMode

Time:04-07

First time post.

I have lovingly hacked my way through some VBA code with copy and paste and am successfully reading a sheet in Excel and creating a Microsoft Project Plan of tasks, Work, Notes,etc, the code is being executed out of MS Excel. However, no matter how I much I try, reading, researching and alike I can not get the Active.Project to assign, SetTaskMode Manual:= False. I receive an error, please note Application.Visible = True.

As far as .Application.Methods (Project) go, I am able to invoke the Application.About screen, i.e on Sub execution the MS Project About screen opens up, however after that line, it stops.

Basically, I would like to set the Active Sheet Task Mode to be set to 'automatically scheduled' as the default for all tasks as they are being imported.

Any help / direction, greatly appreciated.

CodePudding user response:

The project property in question is NewTasksCreatedAsManual and is used like this to make all new tasks auto-scheduled:

ActiveProject.NewTasksCreatedAsManual = False

Alternatively, to set the task mode to auto-schedule on an individual task, use the Manual property like this:

tsk.Manual = False
    
' or to change to manually scheduled
tsk.Manual = True
  • Related