Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Compile Error
I can not figure out why I get a Compile Error (Expected Function or
Variable). It stops at : Module Protection.unprotect_all_sheets. If I run the module on its own it works fine. Private Sub CommandButton1_Click() On Error GoTo Error 'ActiveWorkbook.ChangeFileAccess Mode:=xlReadWrite Worksheets("January").Protect Password:="popcorn" If TextBox1.Text = "popcorn" Then Module Protection.unprotect_all_sheets End If If TextBox1.Text < "popcorn" Then Unload UserFormPassword MsgBox "Invalid password - you cannot access this" ThisWorkbook.Close False Exit Sub Else Unload UserFormPassword End If Worksheets("January").Protect Password:="" GoTo LastLine Error: ThisWorkbook.Close False LastLine: End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
help with this error-Compile error: cant find project or library | Excel Discussion (Misc queries) | |||
VBAProject name compile error, not defined at compile time | Excel Programming | |||
error message: compile error, argument not optional | Excel Programming | |||
How do I get rid of "Compile error in hidden module" error message | Excel Discussion (Misc queries) |