Thanks a lot! The following works now:
Code: Select all
$objServiceManager =
Win32::OLE->GetActiveObject("com.sun.star.ServiceManager")
||
Win32::OLE->new("com.sun.star.ServiceManager")
||
die "CreateObject: $!"; # Get the currently running process or create a new one
$Stardesktop = $objServiceManager->createInstance("com.sun.star.frame.Desktop");
#VB code
#Components = StarDesktop.getComponents
#Enum = Components.createEnumeration()
#While Enum.hasMoreElements
# oDoc = Enum.nextElement()
# If oDoc.supportsService("com.sun.star.sheet.SpreadsheetDocument") AND oDoc.isModified Then
# print oDoc.Title
# End If
#Wend
my $components = $Stardesktop->getComponents();
my $Enum = $components->createEnumeration();
while($Enum->hasMoreElements()) {
my $oDoc = $Enum->nextElement();
if($oDoc->supportsService("com.sun.star.sheet.SpreadsheetDocument") && $oDoc->isModified()) {
push(@retVal, $oDoc->Title());
}
}
If I may trouble you a bit more - how does one extract annotation (multiline) from a Cell ?
To extract value I could do sth like:
Code: Select all
$calc = $Stardesktop->loadComponentfromUrl("$input_file_URL", "_blank", 0, \@inputFileProperties );
$sheet = $calc->getSheets->getByIndex(0);
$cell = $sheet->getCellByPosition($row_num,$col_num);
$cellValue = $cell->getString();
But when I try to get annotations:
Code: Select all
$cellComment = $cell->getAnnotation()->getString();
I get nothing. With Excel API the documentation is very obvious plus I can see objects in debugger - no such luck wit OO.