阅读背景:

如何在php中使用COM类制作受保护的Excel文件

来源:互联网 

My code:

<?

    $file = "Book1.xlsx"; 
    $app = new COM("Excel.application") or Die ("Did not connect");

    echo "Loaded Excel, version {$app->Version}\n"; 
    $workbooks = $app->Workbooks->open($file);
    echo "open <br>";
    $app->DisplayAlerts = 0;
    $workbooks->Password = '1234';
    echo "pss<br>"; //$workbooks->Saveas($file);
    $app->Wookbooks->Saveas($file);
    echo "save<br>";
    $app->Workbooks->Close();
    $app->Quit;

?>
<?

    $file = "Book1.xlsx"; 
    $



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: