Solved

VB Express 2010 - Error with COM object

Posted on 2011-03-01
4
1,671 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

734 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