Home › Forums › Discussion Forum › Can’t close project – “The referenced project cannot be closed…”
Tagged: closing
I have a project called “Introducer.mpp” that uses this VB macro
https://social.technet.microsoft.com/wiki/contents/articles/32126.ms-project-troubleshooting-truncated-project-notes-when-viewingexporting.aspx
Whenever I try to close it, MS Project posts this dialog: “The referenced project cannot be closed. The project is currently referenced by another project and cannot be closed. The problem started when I was futzing around in the VB Developer IDE a couple months ago so it’s related to this macro in some way.
I use this same macro with many other projects and they can all close. After launching MS Project, when I open one of those other projects, Introducer.mpp gets opened as well. I even duplicated Introducer.mpp and it has the same problem.
Does anyone have a clue how I created this problem and how to fix it?
From the title of the linked page I assume you are attempting to export the notes field from MS Project in bulk? I used a different method using XML. The VBA shown below can be done a lot better without using the “select” approach however I was younger and less experienced then 🙂
1) Open the MSP file and save as .XML type
2) In Excel display the Developer ribbon and select Developer / XML / Import
3) Select the XML file and import
3) Close the XML file
4) Trigger the macro below to ensure that each task has it’s notes aligned with it.
Sub Align_and_sort_by_ID()
' Produce by Miles Goodchild, MGC Limited.
'find the last row used and cal it LRall
Dim LRall As Long
LRall = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
'select C3 to the end and move it up 1 row to align notes with task name
Range("C3:C" & LRall).Select
Selection.Cut
Range("C2").Select
ActiveSheet.Paste
'select task names and notes (B2:last row) to move up to align with task ID
Range("B3:C" & LRall).Select
Selection.Cut
Range("B2").Select
ActiveSheet.Paste
'sort on ID to remove all the spaces
Range("A2:C" & LRall).Select
ActiveWorkbook.Worksheets("Sheet1").ListObjects("Table1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").ListObjects("Table1").Sort.SortFields.Add _
Key:=Range("Table1[ns1:ID]"), SortOn:=xlSortOnValues, Order:=xlAscending _
, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").ListObjects("Table1").Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
If at any point you trigger the macro twice, you will need to refresh the data as you will have deleted the top row by accident.
If a cell displays an infinite number of hash signs, hit F2 to see the contents (it’s too long for excel to display)
Note you can filter on C:C to remove blanks to display only tasks with Notes.
You can go on to use this list to produce a report which shows the critical path tasks with their notes or maybe comments about tasks which are due to finish in the next month etc.