environ

UserProfile environ on vba

回眸只為那壹抹淺笑 提交于 2020-03-27 04:52:40
问题 First I'm new to vba coding . I wrote a form in Access 2013 - VBA and created a function that generates a PDF/txt document on button click, thing is that boss wants it to save on a shared folder that´s located on %userprofile% path - like C:\Users\<username>\folder and we have a lot of users. How can I add to the path of the SaveAs2 that i´m using without having to hardcode to each user? Code is like: file.SaveAs2 = ("C:\Users\username\folder\filename.pdf") I tried defining code like: Dim

VBA Excel Username grants access

让人想犯罪 __ 提交于 2020-02-23 08:02:36
问题 Looking for a little help, I have an excel document that should only grant certain users access, all employees have a user name and when they input any information that shows up with their entry. I'm hoping to secure the file so that only certain employees can have access. So far I have Private Sub Workbook_Open() Dim Users As Variant Dim UName As String Dim UFind As Variant Users = Array("JBLOGS", "DOEJOHN", "ASmith", "JanDoe") UName = Environ("UserName") On Error Resume Next UFind =

VBA Excel Username grants access

馋奶兔 提交于 2020-02-23 08:02:20
问题 Looking for a little help, I have an excel document that should only grant certain users access, all employees have a user name and when they input any information that shows up with their entry. I'm hoping to secure the file so that only certain employees can have access. So far I have Private Sub Workbook_Open() Dim Users As Variant Dim UName As String Dim UFind As Variant Users = Array("JBLOGS", "DOEJOHN", "ASmith", "JanDoe") UName = Environ("UserName") On Error Resume Next UFind =