Ghost Views Haunting the Global(+ non-cached Enterprise)

I’m not sure if this issue is coming from the same place as this but after the last ordeal we had rebuilding the enterprise global, I’m not really keen on doing it a second time.  At the least, I’m hoping I can prolong the inevitable.  They don’t seem to like outages around here, and neither do I because I have to jump through a lot of hoops to get approvals, etc.

So rather than try that as a fix for my issue, I’m workin’ the VBA as an attempted workaround.

Here’s the basic issue…

We created a new view.  I did this the right way, creating it in a local project and using the organizer to move it to the global.  I swear.  Anyway, after I’d named it, the process folks asked me to change the name.  I renamed it in the organizer, but after I did, some people would still see the old name floating around in their list of views, while others (including me) saw the new one.

I had one of the “haunted” folks try changing it in their view and even looking in the organizer at the global version – it still had the old name!

I poked around and couldn’t really find much, other than a lot of “yer doin’ it wrong”s, which I don’t think is me. (at least not today)

So, like I do, I came up with my own answer.  It works well, doesn’t crash or slow anything, and no one will be asking silly questions about which view is which.  You can use either or both of these – I found that the first one (renaming) leaves a copy of the wrongly named one, so I told it to rename it, then hide it.  No one will be the wiser.  

I’ll break it down for you, then post it all in one blob at the end:

Location:   This sucker doesn’t go into a module, because it’s activated by an event.  It needs to live in the “ThisProject” portion of the checked out enterprise global.

The first line tells it to activate whenever a project is opened or a new project is created.

Private Sub Project_Activate(ByVal pj As Project)

The next line keeps Project from bugging people about how edits won’t be saved:

Application.DisplayAlerts = False

The next portion is important in our case, since some people don’t have the old name view showing up in their list.  This keeps it from babbling at them about not being able to find the view.

On Error Resume Next

This line edits the name of the view:

ViewEditSingle Name:=”Task Notes and Trackingng”, Create:=False, NewName:=”Task Notes and Tracking”, Screen:=5, ShowInMenu:=True, HighlightFilter:=True, Table:=”Track Details”, Filter:=”Tracking Tasks”, Group:=”No Group”

And this line tells it not to show in the menu:

ViewEditSingle Name:=”Task Notes and Trackingng”, Create:=False, Screen:=14, ShowInMenu:=False, HighlightFilter:=False, Table:=”Time Reporting”, Filter:=”All Tasks”, Group:=”No Group”

 

This is my first dip into the world of VBA for Project, so I’m putting out the disclaimer that this works for me, but I can’t promise anything.  Use at your own risk. (or joy, or whathave you)

Private Sub Project_Activate(ByVal pj As Project)

    Application.DisplayAlerts = False

    On Error Resume Next

    ViewEditSingle Name:=”Task Notes and Trackingng”, Create:=False, NewName:=”Task Notes and Tracking”, Screen:=5, ShowInMenu:=True, HighlightFilter:=True, Table:=”Track Details”, Filter:=”Tracking Tasks”, Group:=”No Group”

    ViewEditSingle Name:=”Task Notes and Trackingng”, Create:=False, Screen:=14, ShowInMenu:=False, HighlightFilter:=False, Table:=”Time Reporting”, Filter:=”All Tasks”, Group:=”No Group”

    Application.DisplayAlerts = True

End Sub

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s