• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Form with limited access

Hello guys,

I have the following problem:

1. One form with 32 questions to assess for a specific purpose that a user can fill. After that he can generate a report pressing a button. All macros and sheets are locked.

2. I need to sell the form for a person or a company. This is a self assessment product.

How can i limit the user to use the form in a specific number of times? And this use can be linked to two personal fields of data like ID and name?

Could you help me, please?

B.R.

Luis
 
Add some code to an On_Open event or Button Press event that stores a value on a Hidden/Locked sheet
Then check the count on File Open or Button Press and put up a warning etc
 
The first sheet whose name is "Perguntas a responder" is the only one is showed and has a button to generate a report. All sheets are locked, workbook and macro as well. I unlocked for you. Many thanks.
 

Attachments

  • Innovation Toolkit - Indicador de Potencial Inovador.xlsm
    535.2 KB · Views: 6
Luis

Have a look at the attached file
It has a very hidden sheet "Sheet1"
In B2 it has a value of 5 which is how many times it has been opened
In B3 it has a value of 10 which is how many times it is allowed to be opened

The Workbook Code Module (EstaPasta_de_trabalho) has an Workbook_Open subroutine that Adds a value of 1 to the Cell B2
Then checks if B2>B3 if it is it closes without saving

You can open the file once it goes past 10 opens by holding the Shift Key when you press Open in Excel
Then go to VBA and reset the counter using
Worksheets("Sheet1").Range("B2").Value = 0 in the Immediate window

You can change the Maximum number of opens using:
Worksheets("Sheet1").Range("B3").Value = 20
in the immediate window

Access the Immediate window using Ctrl G

You can see the values of the counter and Maximum by using:
? Worksheets("Sheet1").Range("B2").Value
? Worksheets("Sheet1").Range("B3").Value
in the immediate window

Also have a read of: http://www.jkp-ads.com/articles/preventopenevent.asp
 

Attachments

  • Innovation Toolkit - Indicador de Potencial Inovador-Hui.xlsm
    528 KB · Views: 8
Hui, testing the file the counter doesnt activate if i dont save the file. Is possible to count if i open and dont save the woorkbook?
 
Just add a line
ActiveWorkbook.Save
line to the end of the Workbook_Open event
Before the End Sub line
 
Back
Top