none
Project 2016 Pro Quality Filter Macro RRS feed

  • Question

  • Hi all, I'm trying to build a simple macro that runs through my DCMA quality filters and copies the 'active' or quality fail UID to a text column called QF1-14 and then exports to Excel. 

    This works on my test project but when I run the recorded macro on other simple projects I get a fail at the 'EditPaste' line (to my QFx column) - definition 'Cannot jump to 'EditPaste' because it is hidden'.

    Any ideas - guessing it's probably an easy one?

    Has anyone got a better macro or solution for running multiple quality filters?

    Thursday, December 12, 2019 4:48 AM

Answers

  • Laup88,

    Yes, marking a response as the answer is appreciated by the one who helped or answered the original post. Note that marking a response as the answer does NOT close the thread and more than one response can be marked as the answer.

    With regard to your question about the "best" way to copy one field to another, it depends. You say you apply a filter and then want to copy the UID field to your custom QF field. That can be done by applying the filter, selecting any column (SelectTaskColumn) or the whole sheet (SelectAll) and then loop through the ActiveSelection.Tasks. It could also be done by selecting the UID column followed by a copy/paste to the QF column. However, unless there is a reason you only want UIDs copied to the QF for the filtered tasks, why not simply copy all UIDs to the QF column. You can always apply a filter to then operate only on tasks in the filtered set.

    Hope this helps.

    John

    • Marked as answer by Luap88 Tuesday, December 17, 2019 10:02 PM
    Tuesday, December 17, 2019 4:37 PM

All replies

  • Luap88,

    Yeah I've got a better macro that will do what you want with a little editing. See the following link:

    https://social.technet.microsoft.com/wiki/contents/articles/32126.ms-project-truncated-project-notes-when-viewingexporting.aspx

    If you need any help modifying it for your specific needs, let me know.

    John

    Thursday, December 12, 2019 4:13 PM
  • Hi John, thanks for your help. What a fantastic article and well written code with notation.  
    Thursday, December 12, 2019 10:16 PM
  • I'm embarrassed but I'm struggling with a compile error at:

    MsgBox "This macro exports the following Project fields to Excel:" & vbCr &

    I cant see anything wrong with this and I've pasted the code in a couple of times.

    Sorry it's been a while and trying to get back into it.

    Thursday, December 12, 2019 11:37 PM
  • Luap88,

    My guess is your copy and paste operation introduced rogue characters so try this. First, did the underscore at the end of the line get copied? If not, add it. The underscore is the symbol for a continued line of code.

    If the underscore isn't the issue, comment out the MsgBox line by inserting an apostrophe symbol at the beginning. That will effectively remove the whole statement from the code, and it will also allow you to find out if there are any other glitches the compiler finds.

    If that is the only error you get you can either leave the opening message commented out or you could re-type it manually.

    If you are still having problems, we can work one-on-one via direct contact.

    John


    Friday, December 13, 2019 4:13 PM
  • Hi John, I've got the macro running with no errors and will attempt to make the changes I need. Thanks so much for your help so far!

    BR,

    Paul.

    Tuesday, December 17, 2019 12:29 AM
  • Paul,

    You're welcome and thanks for the feedback. If I answered your question, please consider marking one of my responses as the answer.

    John

    Tuesday, December 17, 2019 1:24 AM
  • Hi John, I've made most of the changes but I get a Run-time error '9' subscript out of range for t.UniqueID

    Happy to mark this thread as complete if that's the norm.

    Tuesday, December 17, 2019 3:54 AM
  • All fixed. I've started writing the running the filters section and copying the resulting UID to my QF fields. I'm just wondering what the best method is to copy the UID column with a filter applied into a text field.

     
    Tuesday, December 17, 2019 5:45 AM
  • Laup88,

    Yes, marking a response as the answer is appreciated by the one who helped or answered the original post. Note that marking a response as the answer does NOT close the thread and more than one response can be marked as the answer.

    With regard to your question about the "best" way to copy one field to another, it depends. You say you apply a filter and then want to copy the UID field to your custom QF field. That can be done by applying the filter, selecting any column (SelectTaskColumn) or the whole sheet (SelectAll) and then loop through the ActiveSelection.Tasks. It could also be done by selecting the UID column followed by a copy/paste to the QF column. However, unless there is a reason you only want UIDs copied to the QF for the filtered tasks, why not simply copy all UIDs to the QF column. You can always apply a filter to then operate only on tasks in the filtered set.

    Hope this helps.

    John

    • Marked as answer by Luap88 Tuesday, December 17, 2019 10:02 PM
    Tuesday, December 17, 2019 4:37 PM