• 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.

Macro- to Use Text File as a Gate Key?

collinn

New Member
Hi,


I am working on an user form (excel) parked at company's share folder that used by around 30 users. The form is read only for user, but it links to another excel file (2nd file) that they have write access to generate a serial number (always +1) and a log book function. The information user fill in the form will be saved in the 2nd file.


The file works fine when 1 user click on the macro button, and followed by 2nd user (open as read only). Testing was done when 2 users click together for 100 serial numbers, it was found out that the 2nd file is accessed by both user, and same serial number is assigned to both user form which should not happen.....


I tried a few methods in excel but same serial number appeared twice still happen ;(


Is text file can do a better job of Gate Key to allow only one user to access the 2nd write-access file? The initial idea is the text file is with a 'Unlock' as the content. When the 1st user click on the macro button, then the 'Unlock' will change to 'Lock'. When the 2nd user click on the button, it will not continue when the text file is with 'Lock' as content. Is it workable or there is other options? Is Macro can change a text file's contents?


Thank you in advance!!!
 
Check out the text file example here:

http://www.mcgimpsey.com/excel/udfs/sequentialnums.html


The code there is commonly used for generating sequeuntial numbers in Excel, and it uses a text file.
 
Back
Top