Hello Monks, I am facing problem when trying to update a MS project task name cell color. here is my code.
Win32::OLE->FreeUnusedLibraries (); Win32::OLE->Initialize(Win32::OLE::COINIT_MULTITHREADED); my $app; my $project; eval{ $app = Win32::OLE->new('MSProject.Application') or print "Couldn't + open project '$MSPfilename'\n"; $app->{'DisplayAlerts'} = 0; $app->{'Visible'} = 0; $app->{'AskToUpdateLinks'} = 0; $app->OptionsGeneral(0,0,0); $app->FileOpen($MSPfilename); }; if ($@) { my $msg = "A problem was encountered when accessing thefile '$MSPf +ilename'\n" . Win32::OLE->LastError()."\n"; print "$msg\n"; } $project = $app->{Projects}->Item(1); if($app) { if (($project) && $project->Tasks) { my $count = $project->Tasks->Count(); for my $indx (1..$project->Tasks->Count()) { my $Task = $project->Tasks($indx); $Task->{Cell}->{Name}->{CellColor} = 1; } }#End of if appTasks loop. $project->Save(); }#End of if app loop. $app->Quit();
can you please let me know where i am doing wrong. thanks in advance.

In reply to MS project Task name cell color by mohanprasadgutta

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.