Solved

VB Express 2010 - Error with COM object

Posted on 2011-03-01
4
1,631 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

759 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now