-
February 20th, 2006, 04:43 PM
#1
Starting COM object from Win Service...
I can't seem to start a COM object using a windows service. I have added the proper reference. The code works in a Windows Application. This is an example of what I am trying to do:
Code:
Private Sub StartExcel()
Dim XL1 As Excel.Application
XL1 = CreateObject("Excel.Application")
End Sub
Protected Overrides Sub OnStart(ByVal args() As String)
StartExcel()
End Sub
I am actually going to call the StartExcel sub using a timer checking the time of day. But I would like to get the CreateObject working first.
Thanks
Rel
-
February 21st, 2006, 06:05 AM
#2
Re: Starting COM object from Win Service...
You are trying to Interact with the Desktop that is the reason why it is not working. Set Allow Service to Interact With Desktop to True in the Services Control panel.
Although I have never tried this before, but I am not sure if this will work.
-
February 21st, 2006, 09:42 AM
#3
Re: Starting COM object from Win Service...
Thanks for the reply. I have that box checked. Still nothing. No errors in the event viewer. I will have a look at permissions.
Rel
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|