Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6921015
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:13:20+00:00 2026-05-27T10:13:20+00:00

Hey folks, this question can’t be too complicated. Please provide a solution to at

  • 0

Hey folks, this question can’t be too complicated. Please provide a solution to at least figure out the ultimate root cause of the problem.

I currently write an application, which controls Excel through COM: The app creates a COM-based Excel instance, opens some XLS files and reads their contents.

Scenario I

On Windows 7, I start Apache and mySQL using xmapp-control with system administrator rights. All works as expected. The PHP-based controller script interacts with Excel as expected.

Scenario II

A problem appears, if I start Apache and mySQL as ‘background jobs’. Here is how:

  • I created two jobs using Windows 7 Task Planner. One runs apache_start.bat, the other runs mysql_start.bat.
  • Both tasks run as SYSTEM with elevated privileges when Windows 7 boots.

Apache and mySQL work as expected. Specifically, Apache serves HTTP request from clients and PHP is able to talk to mySQL.

When I call the PHP controller, which calls and interacts with Excel using COM, I do receive an error.

The error message comes from Excel [not COM itself] and reads like this:

  • Excel can’t read the specified Excel-file
  • Excel failed to save the file due to an ill-name worksheet

Interestingly, the first during the first run of the PHP-based controller script, it takes a few seconds to render the error message. Each subsequent run immediately renders the error message.

Windows system logs didn’t show a single problem report entry.

Note, that the PHP program and the Apache instance didn’t change – except the way Apache was started.

At least the PHP controller script is perfectly able to read the file-system, since it provides the pathes to the XLS-file through scandir() of a certain directory.

Concurrency issues can’t be the cause of the problem. A single instance of the specific PHP controller interacts with Excel.

Question

Could someone provide details, why this happens? Or provide ways to isolate the ultimate cause of the problem (e.g. by means of a PowerShell 2 script)?

UPDATE-1 :: 2011-11-29

As proposed, I switched the Task Planner job from SYSTEM to a conventional user. Works. Apache and MySQL get started and process request.

Unfortunately, the situation regarding Excel did’t change a bit. Still, I see the error.

As assumed earlier, the EXCEL COM server starts. I’m able to change various settings (e.g. suppress dialogs) without a problem through the COM-instance.

The problem happens while calling this:

$excelComObject->Workbooks->Open( 'PathToXLSFile' );

UPDATE-2 :: 2011-11-30

Added the accounts USER, GUEST and EVERYONE with the READABLE right to the access control list of the XLS file . No change.

Modified the app in such a way, that the PHP part creates a copy of the XLS file as a temporary file and moves the contents of the original file into this. Just to ensure, that the problem isn’t forced by odd file / path names.

Still, the problem persists.

UPDATE-2 :: 2011-12-05

I’m going to send the EXCEL COM-Server methods in such a way, that Excel creates a blank file and saves it to /tmp. Let’s see, if Excel even isn’t able to read this file.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:13:21+00:00Added an answer on May 27, 2026 at 10:13 am

    In the past (read: pre Vista) services had an option called “Allow Service to interact with desktop” which allowed services to spawn windows etc. Starting Vista, this is no longer allowed.

    I suspect Excel is failing because it can’t function under this restriction. Thus, any attempt to run it as a service in your Win7 installation will fail.

    You can Windows XP and allow desktop interaction for your Apache process, which I don’t really recommend for obvious reasons.

    Another approach I would take is to create a PHP script that runs as a regular process and listens on a socket in an infinite loop. Your PHP script that runs under Apache would communicate with the secondary script through the local socket and have the secondary script spawn Excel.

    This may sound complicated but in fact it’s not a lot of code and it fixes a problem you will soon have anyway: You should only have one instance of Excel running or you may run into problems. The secondary script could queue requests, handing off one by one to Excel then taking the next in the queue.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey folks, I have a question which feels stupid but I can't quite say
Hey all. I've been been trying to figure this out for a while now.
Hey folks, sorry this is a bit of a longer question... I have a
Hey I can't figure out an error I got. I had my App working
Hey folks, ok so this is my problem, I need to display HTML code
Hey folks, hoping you can help me get started with IronRuby. I have several
Hey Folks i am trying to compile this C++ program: #include <stdio.h> #include <string.h>
Hey folks, I've got this rather clumbsy piece of xslt which I use to
Hey folks, I am wondering whether android allows to build apps that can send
Hey I'm trying to figure out a regular expression to do the following. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.