473,503 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Service throwing error "Cannot create an ActiveX component.

The applicaiton through which the service is created,
doesnt give that error.

To check the exact issue, I tested with a service
containing this block of code. The service gives the error
when run as local system or even in an account (mine)
For this block of code
Private Sub Timer1_Elapsed(ByVal sender As Object, ByVal e
As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
Dim handle As Integer
errorCount = 1
handle = GetErrorFileHandle
("C:\Temp\ErrorFile.txt")
LogError(0, "Before Try", "Abhi", "Elapsed",
handle)
Try
LogError(0, "Inside Try", "Abhi", "Elapsed",
handle)
Dim obj As New Excel.Application
obj.Visible = True
LogError(0, "before excel
quit", "abhi", "elasped", "handle")
obj.Quit()
obj = Nothing
LogError(0, "Inside Try after
nothing", "Abhi", "Elapsed", handle)
Catch ex As Exception
LogError(0, "Inside Catch", "Abhi", "Elapsed",
handle)
End Try
Timer1.Enabled = False
LogError(0, "End elapsed", "Abhi", "Elapsed",
handle)
FileClose(handle)
handle = Nothing
End Sub

the output was
"04-Sep-2003 08:54:22 | 0 | Before Try | Abhi | Elapsed"
"04-Sep-2003 08:54:22 | 0 | Inside Try | Abhi | Elapsed"
"04-Sep-2003 08:54:22 | 0 | Inside Catch | Abhi | Elapsed"
"04-Sep-2003 08:54:22 | 0 | End elapsed | Abhi | Elapsed

Basically, it throws an error at Dim obj As
New Excel.Application and quits try catch block.
Can someone pinpoint the reason?
TIA
Abhi

Nov 20 '05 #1
0 2204

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

Similar topics

1
3932
by: Fie Fie Niles | last post by:
I have IIS installed on XP Professional workstation machine. I have an ASP page that open connection to an Access database, then when trying to update the database, it gave me the error "cannot...
0
2081
by: weixian_shen | last post by:
I'm trying to call my DLL written in C, and got the error: Cannot marshal field 'b' of type 'mystruct': There is no marshaling support for this type. The 2 functions in the DLL are: void...
0
1359
by: kstriyhon | last post by:
hellow i need to get sharepoint user credentials, in order to get this information i'm using the next code. in a C# web service SPSite site = new SPSite("http://sharepoint/"); SPWeb web =...
3
14850
by: Amjad | last post by:
Hi, I just wrote a test Windows Service that creates a text file on startup (please see my code below). The file is never created. Protected Overrides Sub OnStart(ByVal args() As String) Dim...
2
4089
by: Florian G. Pflug | last post by:
Hi Since sometime yesterday, my postgresql (7.4.5) reports "ERROR: cannot compare arrays of different element types", when I analyze a specific table in my database. Here is the tables...
0
2044
by: mvdkwong | last post by:
I am trying to run a macro that will export a table into a fixed length file (see below). However, when I run it, I get the following error: "Cannot update. Database or object is read-only." I've...
10
4427
by: dermot | last post by:
I have wrriten a small windows service application in visual studio ..net 2003 which listens for incoming FTP files. These files would overwrite over time due to duplicate file names. However any...
2
2174
by: qazmlp1209 | last post by:
class base { public: base() { } base(int number) { priNumber = number ;
2
4048
by: ironmanlarry | last post by:
Hi, I'm trying to do a mail merge from Excel to Word (programatically) and I'm having some trouble creating the Word Document Object. This line of code wordDoc = GetObject("sheet.doc") keeps...
14
3809
by: sarabonn | last post by:
hallo Iam trying to insert a row into a access database using visual c# and iam getting an error " cannot open the action query". here is my code private void button1_Click(object sender,...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
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
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7006
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...
1
5021
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3166
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1519
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.