I had the problem when trying to call Access VBA scripts from PHP; the call was working but Access would never quit. The problem was that the Apache server is running as SYSTEM, and not a user we normally use to run Office. And as the first time a user runs Office, it asked the SYSTEM user to enter its name and initials! ;-)
To correct this problem: Stop Apache, go to Services, Apache, Properties, "Log On" tab, and check "Allow service to interact with desktop. Restart Apache, then open your office application, in a page loaded by the Apache server, with a small PHP code like this, :
<?php
$app = new COM("Access.Application"); $app->Visible = true; ?>
Put the name you want and quit the application. Now your Office application should terminate correctly the next time you load it with a COM object in PHP. You can stop Apache uncheck the "Allow service to interact with desktop", and restart Apache if you like. I don't even require a Quit or anything to be sent to Access, it quits automatically when PHP terminates.
And for those who wish to know how I'm calling Access VBA scripts, instead of using ODBC or any other way to send SQL requests, which does not seem to work to call VBA scripts, I open the database as a COM object and it works fine:
<?php
$db_com = new COM("pathname of the file.mdb");
$result = $db_com->Application->Run("function_name", 'param1', 'param2', '...');
?>