473,394 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Windows Service - Automation Error

Hi All,
I have written VB.NET Windows Service whcih reads some
information from Outlook and creates an Excel report outa
it.

When i make a console application and run the program
everything works fine but same code does not work if i put
it in an Windows service.

My OS : Win2000 Pro

Error is thrown where create object of Outlook ( VB6.0)
Set objOutlook = CreateObject("Outlook.Application")
Can not create Activex Object ( if i run as an exe it
works fine but if i make it as an NTService it throws this
error)

Error is thrown where i say ( VB.NET Win Service)

Public oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
Dim oInbox As Outlook.MAPIFolder = oNS.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderInbox)

System.Runtime.InteropServices.COMException (0x84140102):
Could not complete the operation because the service
provider does not support it

Is this a bug of MS or is there any fix available?
Please let me know

Best Regards
THNQDigital

Nov 20 '05 #1
3 2488
While I do not do much Office programming, I would suspect that if you
set the service user to allow to interact with the desktop, you would
find that the error goes away.

HTH

David

"THNQDigital" <an*******@discussions.microsoft.com> wrote in message
news:29*****************************@phx.gbl:
Hi All,
I have written VB.NET Windows Service whcih reads some
information from Outlook and creates an Excel report outa
it.

When i make a console application and run the program
everything works fine but same code does not work if i put
it in an Windows service.

My OS : Win2000 Pro

Error is thrown where create object of Outlook ( VB6.0)
Set objOutlook = CreateObject("Outlook.Application")
Can not create Activex Object ( if i run as an exe it
works fine but if i make it as an NTService it throws this
error)

Error is thrown where i say ( VB.NET Win Service)

Public oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
Dim oInbox As Outlook.MAPIFolder = oNS.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderInbox)

System.Runtime.InteropServices.COMException (0x84140102):
Could not complete the operation because the service
provider does not support it

Is this a bug of MS or is there any fix available?
Please let me know

Best Regards
THNQDigital


Nov 20 '05 #2
Hi David,

Thanks for the reply.
I found the problem with the service in VB6.0
I had to run the code under Sub Main()( Installation) in a
module Plus i placed all the code that actually creates
the object of the DLL whcih creates objects of Office (
Outlook, Excel) in a module , instead i was running the
code under Form_Load() and other procs whcih create
outlook objects in teh form class only.

But in VB.NET i tried your suggestion to run the service
with User name who has Admin access to the system. But
still the same error..

Best regards
THNQ Digital
-----Original Message-----
While I do not do much Office programming, I would suspect that if youset the service user to allow to interact with the desktop, you wouldfind that the error goes away.

HTH

David

"THNQDigital" <an*******@discussions.microsoft.com> wrote in messagenews:29*****************************@phx.gbl:
Hi All,
I have written VB.NET Windows Service whcih reads some
information from Outlook and creates an Excel report outa it.

When i make a console application and run the program
everything works fine but same code does not work if i put it in an Windows service.

My OS : Win2000 Pro

Error is thrown where create object of Outlook ( VB6.0)
Set objOutlook = CreateObject("Outlook.Application")
Can not create Activex Object ( if i run as an exe it
works fine but if i make it as an NTService it throws this error)

Error is thrown where i say ( VB.NET Win Service)

Public oNS As Outlook.NameSpace = oApp.GetNamespace ("mapi") Dim oInbox As Outlook.MAPIFolder = oNS.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderInbox)

System.Runtime.InteropServices.COMException (0x84140102): Could not complete the operation because the service
provider does not support it

Is this a bug of MS or is there any fix available?
Please let me know

Best Regards
THNQDigital


.

Nov 20 '05 #3
It is not just Admin rights that your service will need. Set the user
to Local System (which has Admin rights on the system only), and check
the "Allow service to interact with the desktop" option.

HTH

David

"THNQDigital" <an*******@discussions.microsoft.com> wrote in message
news:2b*****************************@phx.gbl:
Hi David,

Thanks for the reply.
I found the problem with the service in VB6.0
I had to run the code under Sub Main()( Installation) in a
module Plus i placed all the code that actually creates
the object of the DLL whcih creates objects of Office (
Outlook, Excel) in a module , instead i was running the
code under Form_Load() and other procs whcih create
outlook objects in teh form class only.

But in VB.NET i tried your suggestion to run the service
with User name who has Admin access to the system. But
still the same error..

Best regards
THNQ Digital
-----Original Message-----
While I do not do much Office programming, I would

suspect that if you
set the service user to allow to interact with the

desktop, you would
find that the error goes away.

HTH

David

"THNQDigital" <an*******@discussions.microsoft.com> wrote

in message
news:29*****************************@phx.gbl:
Hi All,
I have written VB.NET Windows Service whcih reads some
information from Outlook and creates an Excel report outa it.

When i make a console application and run the program
everything works fine but same code does not work if i put it in an Windows service.

My OS : Win2000 Pro

Error is thrown where create object of Outlook ( VB6.0)
Set objOutlook = CreateObject("Outlook.Application")
Can not create Activex Object ( if i run as an exe it
works fine but if i make it as an NTService it throws this error)

Error is thrown where i say ( VB.NET Win Service)

Public oNS As Outlook.NameSpace = oApp.GetNamespace ("mapi") Dim oInbox As Outlook.MAPIFolder = oNS.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderInbox)

System.Runtime.InteropServices.COMException (0x84140102): Could not complete the operation because the service
provider does not support it

Is this a bug of MS or is there any fix available?
Please let me know

Best Regards
THNQDigital


.


Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Lorenzo | last post by:
I'm trying to access to a LDAP server by a VB 6 application in order to get info about user. The following code works fine running on Windows 2000 professional but fails on Windows XP. Can...
0
by: DanielBH | last post by:
I am using multiple instances of the SHDocVw.InternetExplorer object, in a standard Windows forms c# app, to repeatedly check a specific set of Web sites for information The only problem is, not...
2
by: W Akthar | last post by:
Hi All, I have written a windows service which runs a small windows application. This windows application queries a sql server database and depending on these results, sets appointments in...
2
by: Alfredo Magallón Arbizu | last post by:
Hello, I have an ASP.NET application that reads an Excel file through automation. The app has a loop until first cell of a row is blank. While the app works perfectly under Windows 2003, it...
0
by: lcifers | last post by:
As mentioned in my earlier post regarding creating an application object from a Windows service, I have a Windows app that I'm migrating to a Windows service. This is the first time I have written...
1
by: Jay | last post by:
Hi, I have been using word automation with .Net framework 1.1 and it works fine with windows services but when i use the same code on .Net framework 2.0 it is not able to destroy the component....
3
by: sokolo | last post by:
Hello, I wrote a windows service application however it is not working. The service is supposed to enter a new task every 5 sec within Microsoft Outlook. Here is the code for application: ...
0
by: kieferzhen | last post by:
I want to write a windows service (myService) by using C++/CLI (Visual Studio 2005). This myService can use MFC function for OLE Automation. Just for a first try, I did the following project...
0
by: kieferzhen | last post by:
I am writing a Windows NT Service based on a MFC EXE with VC++ 6.0. This windows service should use Automation (COM) to read data from a server application every minute. MFC EXE always worked. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.