?
Solved

How to enhance Excel security

Posted on 2008-11-03
1
Medium Priority
?
213 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 50

Accepted Solution

by:
Dave Brett earned 2000 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

764 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