This repository is a example for my vbaRequests module. If you want to use IP validation code, you need to install vbaRequests.
This is a simple code for automatically verification user's IP-address that can help you to block all users who has your Excel Book, Word Document or PowerPoint presentation and who should not have access to it (that is, these users will not be able to open it).
- Install the vbaRequests module.
- Import downloaded module in your Document, Book or Presentation.
- Install
validationIP.basfrommainbranch. - If you using Microsoft Excel:
- Open "
VBAProject→Microsoft Excel Objects→ThisBook" and paste here code from downloaded filevalidationIP.bas.
- Open "
- If you using Microsoft Word:
- Open "
VBAProject→Microsoft Word Objects→ThisDocument" and paste here code from downloaded filevalidationIP.bas.
- Open "
- If you using Microsoft PowerPoint:
- Open "
VBAProject→Microsoft PowerPoint Objects→ThisPresentation" and paste here code from downloaded filevalidationIP.bas.
- Open "
A user whose IP address is not saved to a file with the addresses of users who have access to your book opens the book containing this code and receives an error that his IP address is not saved on the server. Then the book closes. Thus, an unidentified user will not be able to view your Excel workbook and change anything there.
If the user's IP is contained in a file with IP addresses, nothing happens and the book opens correctly without giving any access errors.