$Instance = new COM(string "Component name", string "remote_server_address");
?>
注重:这是用DCOM指令来设置PHP。在未来,PHP开辟者供应Unix下对DCOM的撑持。
标识、办法和属性
标识是一个以下的字串:
MS Word: "Word.Application" or "Word.Application.9"
MS Excel: "Excel.Application" or "Excel.Sheet"
ADOBE Acrobat: "Exch.application" or "PdfDistiller.PdfDistiller"
# 读写一个单位格在一个新的任务表中
# 咱们可以读到这个单位格 E11 (Advertising in the 4th. Quarter)
$sheets = $wkb->Worksheets($sheet); #Select the sheet
$sheets->activate; #Activate it
$cell = $sheets->Cells(11,5) ; #Select the cell (Row Column number)
$cell->activate; #Activate the cell
print "Old Value = {$cell->value}
"; #Print the value of the cell:10000
$cell->value = 15000; #Change it to 15000
print "New value = {$cell->value}
";#Print the new value=15000
#最初,用新值从头盘算这个单位格
$sheets->Calculate;
#必需的假如要盘算,手动则是可选的
#可看到后果总价值(E13单位格)
$cell = $sheets->Cells(13,5) ; #Select the cell (Row Column number)
$number = Number_format($cell->value);
print "New Total cost =$$number - was $47,732 before.
";
#依据盘算公式,告白影响了公司的开支,这里将显示 $57,809