Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Darren Larner
  Where is Darren Larner?
 Dudley
 United Kingdom
 Darren Larner
 Tags
Subject: Windows Service & Excel Automation
Thread ID: 395503 Message ID: 395503 # Views: 47 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Active X Controls & OLE Automation
Date: Wednesday, January 15, 2014 2:41:49 PM         
   


Hi,

I have written a FoxPro application running as a Windows Service and this runs pretty well on the whole despite VFP not natively supporting Windows Services. Anyway, I have an issue with one part of the application when it is performing Excel Automation in this Windows Service Application. The code is set to run every day at midnight. It is when I am trying to instantiate Excel using the following command that I have an issue:

oExcel = CreateObject("Excel.Application")

These are the error details I get back:

19/12/2013 00:17:20 Fail - (H) Nightly Metal Re-cost (Problem with Metal Re-cost - opening Excel - OLE error code 0x8000401a: The server process could not be started because the configured identity is incorrect. Check the username and password. (1426) in hkmetrecost on 0 Details: 8000401a: The server process could not be started because the configured identity is incorrect. Check the username and password - Line Contents: .F.)

The weird thing is that if I manually stop the Windows Service, start it again and then set the code to run again, it runs through fine without any errors.

I have googled this to death and have tried all the various changes to rights in DCOM. I think it is something totally different as the code does actually run correctly if I stop and start the windows service.

Any suggestions or thoughts on this would be very much appreciated.

Regards
Darren

ENTIRE THREAD

Windows Service & Excel Automation Posted by Darren Larner @ 1/15/2014 2:41:49 PM
RE: Windows Service & Excel Automation Posted by Cetin Basoz @ 1/15/2014 5:58:10 PM
RE: Windows Service & Excel Automation Posted by Darren Larner @ 1/16/2014 1:56:00 AM
RE: Windows Service & Excel Automation Posted by Russell Hill @ 1/16/2014 3:50:19 AM