Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old October 31st 08, 11:48 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2008
Posts: 2
Default can not save spreadsheet from a windows service on windows server

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.XlFil eFormat.xlWorkbookNormal,null,null,false,false,Exc el.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?

  #2   Report Post  
Old November 3rd 08, 12:25 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2008
Posts: 75
Default can not save spreadsheet from a windows service on windows server

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.XlFil eFormat.xlWorkbookNormal,null,null,false,false,Exc el.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?

  #3   Report Post  
Old November 3rd 08, 03:48 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Oct 2008
Posts: 2
Default can not save spreadsheet from a windows service on windows ser

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.XlFil eFormat.xlWorkbookNormal,null,null,false,false,Exc el.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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing service reminder popup windows in excel Scotty Excel Worksheet Functions 0 April 22nd 10 05:48 AM
Last Saved by Field not populating with Windows XP Service Pack 2 Rachelle Excel Discussion (Misc queries) 0 March 13th 07 09:11 PM
Creating Windows Message Service Alert NickHK Excel Programming 0 December 4th 06 04:49 AM
what service pack do I have with my windows 2000? Crystal Excel Discussion (Misc queries) 2 April 18th 06 02:44 PM
problem updating link from Novell server to windows server #REF er Ellen Excel Discussion (Misc queries) 0 May 10th 05 09:18 PM


All times are GMT +1. The time now is 02:04 AM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017