Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
setattr
Hi
Is it posible to open a file and us sub auto_open and check if file is vbReadOnly, change it if I`m the right user. Regards Yngve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
setattr
After you write the macro you need to protect the macro so nobody changes the code or will be able to read your password Something like this Private Sub App_WorkbookOpen(ByVal Wb As Workbook) If Environ("UserName") = "XXX" Then If Wb.HasPassword = True Then Wb.Unprotect "Password" End If End If End Sub the username is you PC login name -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=161054 Microsoft Office Help |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
setattr
On 9 Des, 19:09, joel wrote:
After you write the macro you need to protect the macro so nobody changes the code or will be able to read your password Something like this Private Sub App_WorkbookOpen(ByVal Wb As Workbook) If Environ("UserName") = "XXX" Then If Wb.HasPassword = True Then Wb.Unprotect "Password" End If End If End Sub the username is you PC login name -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread:http://www.thecodecage.com/forumz/sh...d.php?t=161054 Microsoft Office Help Hi Joel Thanks Regards Yngve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|