Solved

How to enhance Excel security

Posted on 2008-11-03
1
207 Views
Last Modified: 2012-05-05
I've developed a stand-alone like application in Excel. How can I ensure the application will be used within company's laptops?
As all laptops are in the same domain. I am thinking to check user's domain at the begining before running the application. How I can achieve that in VB or any other better ideas?
0
Comment
Question by:neph1997
1 Comment
 
LVL 50

Accepted Solution

by:
Dave Brett earned 500 total points
ID: 22867889
Hi,

You could search for these domains on the Workbook Open event, if found then progress, or close your application

A couple of sample codes below that list
1) The Workbook open event
2) The domain of the current computer
3) All domains on the current network

Cheers

Dave

 

Private Sub Workbook_Open()

    Dim wshn

    Set wshn = CreateObject("wscript.network")

    Select Case wshn.userdomain

    Case "mine1", "mine2"

        'your code here

    Case Else

        C = MsgBox("Unlicensced used of this addin", vbCritical, "Warning!")

        ThisWorkbook.Close False

    End Select

End Sub
 
 

Sub Domain()

    Dim wshn

    Set wshn = CreateObject("wscript.network")

    MsgBox wshn.userdomain

End Sub
 
 

Sub All_Domains()

    Dim adsNS, adsDomain, WSHshell

    Set WSHshell = CreateObject("WScript.Shell")

    Set adsNS = GetObject("WinNT:")

    adsNS.Filter = Array("domain")

    For Each adsDomain In adsNS

        WSHshell.popup adsDomain.ADsPath

    Next

End Sub

Open in new window

0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

914 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now