Hide columns in MS Project File


#1

Hi,

How to hide or delete columns from Project File i.e., mpp file and save.

I tried with below code, its not working for me,

project.DefaultView.Table.TableFields.Remove(new TableField { Field = Field.TaskResourceNames });

project.Save(@“C:\Ramya\MPP\New\SDM_NewMPP_WithSampleData.mpp”, new MPPSaveOptions { WriteViewData = true });

Please provide me the resolution.


#2

@ramyaakula,

Can you please share source file so that we may further investigate to help you out.


#3

@Adnan.Ahmad

Above already I provided my source code,

Project project = new Projecr(@“C:\Ramya\MPP\Old\blanksdmtemplatea.mpp”)

project.DefaultView.Table.TableFields.Remove(new TableField { Field = Field.TaskResourceNames });

project.Save(@“C:\Ramya\MPP\New\SDM_NewMPP_WithSampleData.mpp”, new MPPSaveOptions { WriteViewData = true });


#4

@ramyaakula,

Can you please share source mpp file which you are using on your end so that i may work on that to help you out.


#5

@Adnan.Ahmad,

PFA my source empty mpp file.

From attached file i need to remove “Resource Names” column.
BlankTemplate.zip (25.4 KB)


#6

@Adnan.Ahmad,

I got the solution, i can able to reove column using below code,

project.DefaultView.Table.TableFields.RemoveAt(8);


#7

@ramyaakula,

Its good know to you that have resolved your issue.