Test for Administrator

E

Ed

I have a VBA routine that I want to run one way for a 'regular user' and
another way for a user with Adminstrator rights (or PowerUser rights). Can I
test for that via VBA coding?

Thanks.

Ed (in Virginia)
 
J

Jonathan West

Hi Ed in Virginia

This article shows you how to find out if you are running as administrator

LookupAccountSid: Determine if the Current Process is Running Under Admin
Account
http://vbnet.mvps.org/index.html?code/network/isadministrator.htm

The code example is VB6 rather than VBA, but the necessary tweaks to get it
working in VBA should be minimal.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top