Guild of Project Controls: Compendium | Roles | Assessment | Certifications | Membership

Tips on using this forum..

(1) Explain your problem, don't simply post "This isn't working". What were you doing when you faced the problem? What have you tried to resolve - did you look for a solution using "Search" ? Has it happened just once or several times?

(2) It's also good to get feedback when a solution is found, return to the original post to explain how it was resolved so that more people can also use the results.

VBA code please

4 replies [Last post]
Hemanth Kumar
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 1 Nov 2002
Posts: 260
Groups: None

Hi All
Can someone help me for writing a macro
for hiding all task bars
Thanks

Replies

Niek Zonneveld
User offline. Last seen 2 years 20 weeks ago. Offline
Joined: 17 Mar 2005
Posts: 188
Groups: None
My pleasure Hemanth,

If you always want to apply this for the entire project you should replace "ActiveSelection.Tasks" by "ActiveProject.Tasks" in the code I’ve sent you earlier.

H.T.H.

Niek.
Hemanth Kumar
User offline. Last seen 1 year 8 weeks ago. Offline
Joined: 1 Nov 2002
Posts: 260
Groups: None
Thank You Niek
Dear James

My Project if not opened without enabling macros will be shown as a dis organised crap without any bars

So The viewer has to enable macro to view it. which will trigger a series of other macros which prevent edit,,print,, save,, show copy right informations etc etc

i dont want somebody even my client copy my plan and reuse it



James Griffiths
User offline. Last seen 15 years 33 weeks ago. Offline
Joined: 19 May 2006
Posts: 435
Groups: None
There is no need to write a macro. Just highlight all the activities, click on the Task Information icon,General tab and then tick the "Hide Task Bar" box.

HTH.

James.
Niek Zonneveld
User offline. Last seen 2 years 20 weeks ago. Offline
Joined: 17 Mar 2005
Posts: 188
Groups: None
Hemanth,
This module removes all the bars for selected tasks:

*****************************************
Sub Hide_bars()

Dim t As Task

For Each t In ActiveSelection.Tasks

t.HideBar = YES

Next t

End Sub
******************************************

This is a very simple example. You’ll need to write error handling around it to make it robust.

H.T.H.

Niek.