G
Guest
Hi, All!
I'm working on a C# windows service project in witch I'm using MS Excel and MS Outlook
automation objects referenced through Microsoft Excel 10.0 Object Library
and Microsoft Outlook 10.0 Object Library.
On my local computer, calling methods and accessing properties on these automation
objects works smoothly. However, when I try running the service, having deployed it on the production
server, the execution halts on the first attempt to invoke a method or access a property
on one of the automation objects. Strange thing is that no exception is thrown, the service just
halts and doesn't seem to get any further in execution.
Consider the following code snippet:
//->
Excel.Application xlApp;
Excel._Workbook xlWbk;
Excel.Worksheet xlWst;
xlApp = new Excel.Application(); // <-- The call to the Excel.Application constructor returns OK.
// However, neither of the following lines of code are ever executed.
// The execution of the service just halts, waiting for control to be
// returned from the automation object. -->
xlApp.AlertBeforeOverwriting = false;
xlWbk = xlApp.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet);
//<-
Just for the record, I've copied the versions of Interop.Excel.dll, Interop.Outlook.dll, Interop.VBIDE.dll
from the the project directory on my local computer, onto the production server, in the same
directory as my Windows Service executable. Any of you guys having an idea of what's causing
this problem?
I'm working on a C# windows service project in witch I'm using MS Excel and MS Outlook
automation objects referenced through Microsoft Excel 10.0 Object Library
and Microsoft Outlook 10.0 Object Library.
On my local computer, calling methods and accessing properties on these automation
objects works smoothly. However, when I try running the service, having deployed it on the production
server, the execution halts on the first attempt to invoke a method or access a property
on one of the automation objects. Strange thing is that no exception is thrown, the service just
halts and doesn't seem to get any further in execution.
Consider the following code snippet:
//->
Excel.Application xlApp;
Excel._Workbook xlWbk;
Excel.Worksheet xlWst;
xlApp = new Excel.Application(); // <-- The call to the Excel.Application constructor returns OK.
// However, neither of the following lines of code are ever executed.
// The execution of the service just halts, waiting for control to be
// returned from the automation object. -->
xlApp.AlertBeforeOverwriting = false;
xlWbk = xlApp.Workbooks.Add(Excel.XlWBATemplate.xlWBATWorksheet);
//<-
Just for the record, I've copied the versions of Interop.Excel.dll, Interop.Outlook.dll, Interop.VBIDE.dll
from the the project directory on my local computer, onto the production server, in the same
directory as my Windows Service executable. Any of you guys having an idea of what's causing
this problem?