LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default 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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"