PC Review


Reply
Thread Tools Rate Thread

can not save spreadsheet from a windows service on windows server

 
 
dragonemp
Guest
Posts: n/a
 
      31st Oct 2008
I have a service app that create excel spreadsheet automatically. this worked
on xp and windows server 2003. but now i need it work on windows server 2008.
When the service run to this line
_workBook.SaveAs(excelPhysicalFilePath,Excel.XlFileFormat.xlWorkbookNormal,null,null,false,false,Excel.XlSaveAsAccessMode.xlExclusive,false,false,null,null,null) ;
it always returns error "System.Runtime.InteropServices.COMException
(0x800A03EC): Exception from HRESULT: 0x800A03EC"

however, I also has an windows form test app which runs exact same code, but
it works. So i wonder maybe the error is related to some new restriction
implemented for service/DCOM in windows server 2008, can somebody give me
some idea how to solve it?
 
Reply With Quote
 
 
 
 
Alan Moseley
Guest
Posts: n/a
 
      3rd Nov 2008
Is it permissions? Your service will either be running under the Local
System account, or you will have specified it to use another account. If it
is running under Local System then try assigning another username to it (in
the Services applet in Administrative Tools).

Alternatively, is excelPhysicalFilePath pointing at a mapped drive? Mapped
drived do not exist from a service's perspective.

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"dragonemp" wrote:

> I have a service app that create excel spreadsheet automatically. this worked
> on xp and windows server 2003. but now i need it work on windows server 2008.
> When the service run to this line:
> _workBook.SaveAs(excelPhysicalFilePath,Excel.XlFileFormat.xlWorkbookNormal,null,null,false,false,Excel.XlSaveAsAccessMode.xlExclusive,false,false,null,null,null) ;
> it always returns error "System.Runtime.InteropServices.COMException
> (0x800A03EC): Exception from HRESULT: 0x800A03EC"
>
> however, I also has an windows form test app which runs exact same code, but
> it works. So i wonder maybe the error is related to some new restriction
> implemented for service/DCOM in windows server 2008, can somebody give me
> some idea how to solve it?

 
Reply With Quote
 
dragonemp
Guest
Posts: n/a
 
      3rd Nov 2008
It's not permission, my service is run under local system and the folder has
been given full control to everyone......
I believe it has something to do with the way windows server 2008 handles
service/DCOM call, because that's the only difference between the test app
and service.
and excelPhysicalFilePath is pointing to local drive.

"Alan Moseley" wrote:

> Is it permissions? Your service will either be running under the Local
> System account, or you will have specified it to use another account. If it
> is running under Local System then try assigning another username to it (in
> the Services applet in Administrative Tools).
>
> Alternatively, is excelPhysicalFilePath pointing at a mapped drive? Mapped
> drived do not exist from a service's perspective.
>
> --
> Alan Moseley IT Consultancy
> http://www.amitc.co.uk
>
> If I have solved your problem, please click Yes below. Thanks.
>
>
> "dragonemp" wrote:
>
> > I have a service app that create excel spreadsheet automatically. this worked
> > on xp and windows server 2003. but now i need it work on windows server 2008.
> > When the service run to this line:
> > _workBook.SaveAs(excelPhysicalFilePath,Excel.XlFileFormat.xlWorkbookNormal,null,null,false,false,Excel.XlSaveAsAccessMode.xlExclusive,false,false,null,null,null) ;
> > it always returns error "System.Runtime.InteropServices.COMException
> > (0x800A03EC): Exception from HRESULT: 0x800A03EC"
> >
> > however, I also has an windows form test app which runs exact same code, but
> > it works. So i wonder maybe the error is related to some new restriction
> > implemented for service/DCOM in windows server 2008, can somebody give me
> > some idea how to solve it?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Windows Service with Excel Object-Windows Server 2008 (64 Kevin M Microsoft Excel Programming 0 12th Dec 2008 10:57 PM
Bug: Windows Modules Service Is Broken In Windows Server 2008 Beta 3 Web Server Addition. Windows Vista General Discussion 26 24th May 2007 10:56 PM
Strange problem when running a Windows service using Windows Server 2003 Martijn Remmen Microsoft Dot NET 0 22nd Oct 2005 02:09 PM
Process.Start() in windows service on Windows Server 2003, problem Tobias Johansson Microsoft C# .NET 2 21st Feb 2005 01:45 PM
How can I easily register one windows service exe on a single Server as different windows services? Jon Microsoft Dot NET Framework 0 21st Nov 2003 03:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:52 AM.