Select file from input box RRS feed

  • Question

  • I am trying to write some code that allows me to copy data between two projects.

    I have the copy part of the code written, however the source file is variable the destination file name should remain constant

    Ideally I would like an input box that has a drop down with the two files that are currently open within MSP listed and they can select the source and destination files

    Alternatively I will use a message that asks them to select the source file before proceeding, however again I am nearly there but cant seem to put a break into the code to allow the changing of the project file. I can stop the macro and the select and re-run, but not quite such a polished solution as I would like.

    The input box and crop list would be best solution for me if anyone has any ideas

    Thanks AMH666

    Thursday, August 4, 2011 10:32 AM

All replies

  • Hi,

    I understand both files are open?


    dim P0 as project

    dim ProjectA as project

    dim ProjectB as project

    for each P0 in Projects

    select case

    Case "Name of first project"

    set projectA=P0

    Case "Name of second project"

    set ProjectB=P0

    end select

    Now you can address data of rojectA or ProjectB at will.




    Thursday, August 4, 2011 10:50 AM
  • Hi Jan,


    Thanks for response I tried the above but get an error that a Next has not been added, so I added a next after end select however po gets the file name into it, but it doesn transfer to projecta or b, the code seems to skip that line in the code when I f8 through it

    Thursday, August 4, 2011 11:53 AM
  • Hi,

    I just showed you how to address both projects. The rest is up to you.. reading the project's name in the text box, using the name to use ProjectA or ProjectB, make the transfer.. I thought you knew how to do that, you only asked how to select either file: that's done.


    Friday, August 5, 2011 9:12 AM