MS Project task name cell color
Hello,
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();
Win32::OLE(0.1601) error 0x8002000e: "Invalid number of parameters"
in METHOD/PROPERTYGET "" at msprojcq.pl line 237
i am getting error
line number 237 is my $obj = $project->Tasks->SelectRow({Row => $indx, Column
+ => "Name"});
(i have removed some unnecessary code from my program while posting)
can you please let me know where i am doing wrong.
thanks in advance.
 |
Not the answer you were looking for? Post your question . . .
189,798 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).
|
|
|
Latest Articles: Read & Comment
Top Perl Forum Contributors
|