Runtime Error 1101 When Using Macro to Distribute Customisations


  • Hi,

    Project 2016 Professional, Windows 10.When running the following macro I am receiving the 1101 error:

    Sub DistributeTest()

    OrganizerMoveItem Type:=10, FileName:="Global.MPT", ToFileName:=ActiveProject.Name, Name:="NameOfTheItem"

    End Sub

    This is similar to this problem

    but my code does not contain the (same) errors.

    Mittwoch, 16. Mai 2018 14:16

Alle Antworten

  • Whats Going Ahn,

    I just did a quick test and the issue has to do with the ToFileName argument. It only works if I use the full path. For example, my active file is "Sub A" so

    OrganizerMoveItem Type:=10, FileName:="Global.MPT", ToFileName:=ActiveProject.Name, Name:="NameOfTheItem"

    does not work. However,

    OrganizerMoveItem Type:=10, FileName:="Global.MPT", ToFileName:="C:\Users\John\Documents\Sub A.mpp" Name:="NameOfTheItem"

    does work.

    Hope this helps.


    Mittwoch, 16. Mai 2018 15:03
  • Thanks John. It's a useful workaround, but I need to distribute to a number of different files. That's why I am using the "ActiveProject.Name" approach.

    I need to loop through the files and apply the customisations to each one. I didn't include the loop as I'd already made sure it wasn't the issue.

    Mittwoch, 16. Mai 2018 15:36
  • Whats Going Ahn,

    It's not a workaround, its simply the way the Method works. Sometimes VBA syntax can be fussy so you have to go with what works. So loop through the files, find the path and make the Organizer move.


    Mittwoch, 16. Mai 2018 15:47
  • It's the workaround I'm currently using because of this problem, as it works but it's likely that it will quickly become unmanageable for me in my current situation.

    I need to abstract away from specific filenames and, TMK, "ActiveProject.Name" is the way to do that. I need to be able to easily add and delete project files so I need to be flexible. I started using the same code some years has always worked fine.

    In detail the code accesses each project via a hyperlink. When the project is open the customisations are assigned. The file is saved and closed, on to the next

    I know it isn't the code to open and close the projects that is causing the problem, which is why I didn't add it to the OP.

    Mittwoch, 16. Mai 2018 16:43
  • I have macros that use OrganizerMoveItem and they use a hard-coded filename without a path. However, I'm moving in the opposite direction, from my file into the Global. If a path is required to make it work, use ActiveProject.FullName. You may have to assign it to a string variable first.
    Mittwoch, 16. Mai 2018 17:09