Is the current view a gantt view

M

Mark Durrenberger

How do I test to find out if the current view contains a gantt chart

I'm close with the code below - it reveals if I have a task view but the
macro I've written only works with gantt charts... so I gotta know :)

Thanks,
Mark


Dim v As Variant, blnView As Boolean
For Each v In ActiveProject.TaskViewList
If v = ActiveProject.CurrentView Then blnView = True: Exit For
Next

If blnView Then
MsgBox "Is a Task View"
Else
MsgBox "Is a Resource View"
End If


--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is
that failure comes as a complete surprise and is not
preceded by a period of worry and depression.

- Sir John Harvey-Jones
 
G

Gérard Ducouret

Hello Mark,

The ActiveProject.CurrentView property returns the name of the active view.
So you cant check if it is the "Gantt Chart" or another name you gave to the
Gantt chart.

Hope this helps,

Gérard Ducouret
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top