Setting the view-able area of the left pane of the "Gantt chart view" through VBA RRS feed

  • Question

  • Hi,

    Can we set the view-able area through VBA.

    I tried recording a macro and adjusting the size but the no code was generated inside the sub routine.The size is getting changed since I am looking for some unwanted columns and deleting the same.


    Wednesday, May 6, 2015 7:33 AM


All replies

  • becks23,

    What exactly do you mean by "view-able area"? And when you say "size", to what are you referring? A clearer explanation of what you need will help us help you.

    What is your end goal? Generally, if nothing results when you record a macro (foreground mode), you also won't be able to create a macro that works in background mode but there are exceptions.

    By the way, what ever happened to your first post ( Both Rod and I gave a response but no feedback from you.


    Wednesday, May 6, 2015 2:30 PM
  • Hi John,

    Is it possible to fix the position of the separator through VBA. What I said left pane is area where we have Task mode,Task Name,Duration,Start,Finish.

    Right side is where we have gantt chart. 


    Friday, May 22, 2015 10:27 AM
  • becks23,

    As far as I know, that view attribute is not controllable through VBA. However if you want to maximize the tabular data (i.e. not much Gantt display showing), or don't want the Gantt display at all, use the Task Sheet view. One the other hand if you want to maximize the Gantt display and only have a few field columns (e.g. ID, Name, Duration), create a custom view table with just those fields. The vertical divider will automatically slide over to the left  against the last column.

    Hope this helps.


    Friday, May 22, 2015 2:30 PM
  • There is the application.SetSplitBar method. application.SetSplitBar 4 moves the vertical split to show the 4 leftmost columns (including the Id). I don't think there is a way to set the horizontal split position.

    Rod Gill
    Author of the one and only Project VBA Book

    • Marked as answer by becks23 Monday, May 25, 2015 12:43 PM
    Sunday, May 24, 2015 9:23 PM
  • Awesome!!!, Rod.

    Thanks a lot.It worked sweet and solved my problem.


    Thanks for your suggestion.

    Monday, May 25, 2015 12:42 PM
  • becks23,

    You're welcome and thanks for the feedback. We both learned something from Rod.


    Monday, May 25, 2015 2:33 PM