Allow VBA Program to use in Specific Computer

S

shahzad4u_ksa

Hi,

I made a VBA application, and I want to use this application in only
one computer, suppose I am working in a company, and all computers are
connected to the Network. every one has his own username and
password.

I want to give this VBA PROGRAM to Network User "ShahzadZ"

and I want to use this program only for "ShahzadZ" not others. even
my computer can be use for different Network Users.

OR

My this program can be restricted only one PC.

how to do this .......... pls give me the suggessions.

Waiting for your response.

Best Regards

Shahzad
Madinah Hilton
 
M

Mike H

Maybe

Sub sonic()
If Environ("Username") = "ShahzadZ" Then
'Your code
Else
Exit Sub
End If

End Sub

Mike
 
N

NateBuckley

Hello, I'm unsure on a full solution for your problem but I can point you in
the direction of getting the Computer Name on the network -

Goto this link

http://allapi.mentalis.org/apilist/GetComputerNameEx.shtml

And check out the example, remember to view the "Immediate Window" to view
the output, then perhaps you could do some kind of IF ComputerNameDnsHostname
= "Wanted Name" THEN Do something
 

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