-
Automatically add code to ThisWorkbook
I have files that I create that I share with others. Due to the office situation making the files read only doesn't work for some people and IT isn't of help. So I wrote the following code:
[VBA]' Allow only me to open the file in a read/write
If Not Application.UserName = "usernamehere" Then
ThisWorkbook.ChangeFileAccess xlReadOnly
End If
End Sub[/VBA]
This opens the file read only and does what I need.
I have a tool bar (xla add-in) that I have created that is used by several other engineers. I would like this function made available to them by just clicking a button.
I would like the code to determine the username and add it to the "usernamehere". Then add all of the code to the current workbook they are working in, ThisWorkbook module.
How do I go about writing the code that will create new code in ThisWorkbook module?
-
-
Check out Chip Pearson's Programming To The Visual Basic Editor
Hope that helps,
Smitty
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules