Closed Thread
Results 1 to 3 of 3

A macro to check whether a user is authorized to run a other macro.

  1. #1
    abhay_547
    Guest

    A macro to check whether a user is authorized to run a other macro.

    Hi All,

    I have created an excel addin which contains some macros but i have sent the same to all my team members but i want to restrict some of the team members from using the same .i.e who are not authorized to use the above mentioned addin. So I want a macro which should first check the existence of a user's XP ID in my sql database table and then allow him to run the macro from my addin. If the user's XP ID is not present in my sql database then it should show a message that "You are not a authorized user to run this macro". I have a code with me which actually checks the existence of Windows XP user id in Excel workbook but I want a code which should check the existence of XP id in sql server table. Following is the code :

    I have the below code so far :

    Please Login or Register  to view this content.
    Please expedite... I already have the above mentioned code in place which works fine with excel I just want to use the same with SQL data table and apart from that I require some thing like below.

    Example code required by me :
    Please Login or Register  to view this content.
    Thanks for your help in advance.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: A macro to check whether a user is authorized to run a other macro.

    Maybe a simple InputBox would do the job....

    My Password

    is the password

    Please Login or Register  to view this content.

  3. #3
    abhay_547
    Guest

    Re: A macro to check whether a user is authorized to run a other macro.

    Hi Davesexcel,

    Thanks for your reply, But I don't want the user to enter any password. My macro should try to capture his windows xp user id with the below code and then check whether the same XP ID exists in the SQL data base table and if it exists in the sql database table column then it should allow user to run the other macro otherwise it should show a message to user that you are not authorized to run this macro. Below mentioned code works fine with Excel. I only want to change it to some extent so that it works fine with SQL table.

    Macro 1 : to check the windows xp userid of a user :
    Please Login or Register  to view this content.
    Macro 2 : to check whether a particular xp userid exists in a excel file (Now I want to change the below code so that it works with sql table) :
    Please Login or Register  to view this content.
    Macro 3 : to check whether a user id exists and in sql table and immediately run the other macro (This macro is to avoid writing above Test macro again and again which is quite big)

    Please Login or Register  to view this content.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1