Solved

VB Express 2010 - Error with COM object

Posted on 2011-03-01
4
1,656 Views
Last Modified: 2012-05-11
I get an error when I attempt to Debug my app, the error occurs when I try to reference the COM object with this line of code:

Dim jb As New JBRequestProcessor()


The error is:

Retrieving the COM class factory for component with CLSID {0685ACEC-94F4-4828-99FB-DD2AA787E703} failed due to the following error: 800702e4 The requested operation requires elevation. (Exception from HRESULT: 0x800702E4).
0
Comment
Question by:JMO9966
  • 2
4 Comments
 
LVL 8

Expert Comment

by:PagodNaUtak
ID: 35014045
0
 
LVL 12

Accepted Solution

by:
Hairbrush earned 500 total points
ID: 35016154
I presume your application is running on either Windows Vista or Windows 7.  These operating systems come with UAC (User Account Control) which prevents certain operations being carried out by a "standard" user.  If you start VB Express 2010 by right-clicking on the icon and selecting "Run as Administrator" then the code should run fine in your debugger.

It is likely that the application you are developing may need to be run as Administrator when you have finished coding and want to run your .EXE.  The same approach can be used when the user starts the EXE.

It would be a good idea to rewrite your code as follows:

Dim jb as JBRequestProcessor
Try
     jb = New JBRequestProcessor
Catch ex as System.Runtime.InteropServices.COMException
     'handle the error, e.g. display a message box saying that the user should restart the application, running it as Administrator
End Try
0
 

Author Comment

by:JMO9966
ID: 35043516
Thanks, I did have the com object's executable to Run As Administrator, but was still getting the error.

I ended up turning off User Control permissions and now it runs fine.  Not a long term solution but I'm good for now.
0
 
LVL 12

Expert Comment

by:Hairbrush
ID: 35043661
Glad that's worked for you.  Please don't forget to close the question ;o)
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Help with Syntax 9 37
Get Client IP on RDS - VB.NET 15 47
Show/Hide ASP.NET controls with JQuery best practices 3 48
Get distinct values from excel or comm seperated file 4 24
Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question