Here's the problem: when the program tries to connect to the internet, Windows does not ask for admin approval, but the connection is blocked. This is not a problem when logged in with admin privileges.
Main Topics
Browse All TopicsDear Experts,
My VB6 program needs to access the internet to register its license when running in standard user mode. How can I get Windows Vista to ask for administrator approval with the standard dialog box for this operation and then return to standard user privileges right afterward?
Thanks!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Uploaded the set of tools created to assist with elevations.
http://www.ee-stuff.com/Ex
Hi ttobin333,
Yes choose any GUID value but make sure you don't change it after you install the registry locations.
When you create ActiveX.dll it has some static information that won't change after compiling. I recommend that when you are ready for deployment make a (release) build by changing the compile options for the activex.dll to (binary compatability) after you compile use the COM dumper to get the CLSID,IID. It's important that these values will never change and will be the same on every system (binary compatability) makes sure this happens.
What you place within the activex.dll is your administrative tasks. This is anything that needs to be run as administrator to work.
The simplest example of this would be trying to create a file on the ROOT drive of C:\ etc..
To make things easier for you and not get to much into classes you can think of the class.cls as a module where some restrictions apply. The basic concept here is to know which operations you will perform that require administrative access and add these to that class instead of your main process.
The only mis-leading part about this whole elevation process is installing the registry locations during the install process. In VB6 by default you can't execute code when you register the activex.dll. However in C++ you can add code to the DllRegisterServer stub and whenver you register the C++ dll it will execute the code inside that stub. Because VB6 can't do this you have to make a workaround.
The best options:
1) Create a C++ MFC DLL that it's only purpose is to install these registry locations. You would first register the VB activex.dll then you would register the C++ MFC dll which will install the registry entries required for the VB activex dll.
2) You can create small program that runs as administrator as the final step of the install process that will install these registry locations. This can be as simple as a form that would indicate to the user "To help better your experience on windows Vista such and such application needs install additional information. Click OK to continue.
Keep in mind that the registry entries need to be installed "AFTER" you register the VB activex.dll.
3) You can create a registry script that installs this entries.
As you can see the only downside here is that VB6 can't execute code when the DLL is registered so you have to use one of the above options instead. This isn't to much of a problem if you take a proffesional approach for Option 2. Option 1 may be difficult but is probrably the best although it requires that you know how to call the registry API's in C++.
One thing I left out of the article and I think the project example is that before you actually elevate you should check that the process is running with standard user access token.
Now before we go any further it's prob a good idea to see what is failing on your side. It's possible you don't need to use any of this and that your download fails because you are being denied access to that folder location. For this purpose it's recommended that all files be placed in Application Data because even standard user can read/write at this location. It's only specific tasks that should really be put into place using this method on vista.
Remember that these entire steps are targeted towards working with UAC under vista and your application should be responsible for determine the OS version act accordingly. ex..
If XP OS use impersonations if user running as standard user.
The small example snippet attached is what it should really look like for application calls.
ttobin333.
I would like to update you with a VB.NET version if you ever decide to move to VB.NET or already have done so for some projects.
http://www.experts-exchang
-egl
HI egl1044
I need some help to implement this in Acc2007 on a Win7 box, can you assist? I can open another Q, I need step by step intrux on how to use your vistauac.zip for Acc2007.
The problem I am having is with CreateObject in Acc2007 VBA code:
Dim ExcelSheet As Object
Set ExcelSheet = CreateObject("Excel.Sheet"
I get the 'requested operation requires elevation' msg
PS: egl1044,
BTW you article at
http://www.experts-excha
i
Hi, LukeB
This won't work with what I think your trying to do.... It's for implementing COM elevation in your own COM/ActiveX dll's you compile. The reason it will fail is because there is strict requirments of registering the COM class for elevation something that you don't have control over with excel automation.
If you are using macros from within excel then I don't see a way around this unless you elevate the application itself using Run As Admin. However if you have access to VB6 where you can compile into an executable you "should" be able to elevate your process and use excel automation using early binding.
I recently removed all elevation articles for revision. I am in the process of re-working elevation into a toolkit for VB and .NET but there is no specific time frame when that will be finished.
Business Accounts
Answer for Membership
by: BrianGEFF719Posted on 2009-10-28 at 03:12:57ID: 25681447
I believe that you have to take an action that requires administrator privileges and windows will issue the authentication request automatically.