Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
(ms excel 2003) If I have a particular workbook open which contains macros
and If I happen to walk away and the computer locks... upon unlock the vba editor pops up automatically. This particular workbook didnt do this until I added some lines of code that unprotected one of the sheets so the macro could write to it and once it was finished it protected the sheet again. Activesheet.Unprotect ("My_Password") Activesheet.Protect Password:="My_Password" |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() You probably protected the wrong sheet and you are getting an error some place in th code or you added a break point in the code. You sholdn't be seening the VBA editor unless you have an error. Do the following 1) Check all your worksheets/cells to see which are protected and which aren't protected. Go to the menu to protect a sheet. If it says protect , then it it not protected. If it say Unprotect, then it is protected. 2) Change your code to specify the shet you want to protect by name, not active sheet. from Activesheet.Unprotect ("My_Password") Activesheet.Protect Password:="My_Password" to Sheets("Sheet1").Unprotect ("My_Password") Sheets("Sheet1").Protect Password:="My_Password" 3) Change you error trapping to trap on all errors VBA menu Tools - Options - General - Error Trapping - Stop on All Errors Errors often cause macro to stop. 4) Remove all "On Error Resume Next" and other error statements. Again Errors often cause macros to stop -- joel ------------------------------------------------------------------------ joel's Profile: 229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170651 Microsoft Office Help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Visual Basic Editor Window Opens Automatically | Excel Programming | |||
Visual Basic Editor Window Opens Automatically | Excel Programming | |||
Why? When I unlock my machine Visual Basic Editor appears (when I'min Excel) | Excel Programming | |||
Visual Basic Editor opens bi itself | Excel Discussion (Misc queries) | |||
Can I run Visual Basic procedure using Excel Visual Basic editor? | Excel Programming |