Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB Express 2010 - Error with COM object

Posted on 2011-03-01
4
Medium Priority
?
1,722 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 12

Accepted Solution

by:
Hairbrush earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

722 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