Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compile Error in 97 - Module 1 - Built in XL 2000 HELP!!

Status
Not open for further replies.

AustinMan

Technical User
Feb 26, 2003
40
US
I have a compile error in Module 1. Here is the code.

I have this statement and call ShowDialog
(Application.Run) on Worksheet Selection Change Event.

Why is this not working? I am at a loss. Thanks for your
help.

Thanks! George C.

Public Sub Decide2()
#If VBA6 Then
Call ShowModeless2
#Else
Job_Function.Show
#End If
End Sub

Public Sub ShowDialog()
Dim Msg As String
Dim Response As VbMsgBoxResult
Dim Style As MsoButtonStyle
Dim Title As String

Style = vbYesNo + vbCritical + vbDefaultButton2

Msg = "Do you want to add/change/delete job functions in
this cell?" & vbCrLf & vbCrLf & "If you do, you will need
to re-enter all the job functions again."
Title = "Job Title Selection Change"


If (((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = "$D$11") Or (ActiveCell.Address
= &quot;$E$11&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Or _
(((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = &quot;$D$13&quot;) Or (ActiveCell.Address
= &quot;$E$13&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Or _
(((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = &quot;$D$15&quot;) Or (ActiveCell.Address
= &quot;$E$15&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Or _
(((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = &quot;$D$17&quot;) Or (ActiveCell.Address
= &quot;$E$17&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Or _
(((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = &quot;$D$19&quot;) Or (ActiveCell.Address
= &quot;$E$19&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Or _
(((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = &quot;$D$21&quot;) Or (ActiveCell.Address
= &quot;$E$21&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Or _
(((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = &quot;$D$23&quot;) Or (ActiveCell.Address
= &quot;$E$23&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Or _
(((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = &quot;$D$25&quot;) Or (ActiveCell.Address
= &quot;$E$25&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Or _
(((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = &quot;$D$27&quot;) Or (ActiveCell.Address
= &quot;$E$27&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Or _
(((ActiveCell.Column = 4) Or (ActiveCell.Column = 5))
And ((ActiveCell.Address = &quot;$D$29&quot;) Or (ActiveCell.Address
= &quot;$E$29&quot;)) And (ActiveCell.Value <> &quot;&quot;)) Then

Response = MsgBox(Msg, Style, Title)
If Response = vbNo Then
ActiveSheet.Unprotect Password:=&quot;2Tough&quot;
Selection.Locked = True
ActiveSheet.Protect Password:=&quot;2Tough&quot;
ActiveSheet.Unprotect Password:=&quot;2Tough&quot;
Selection.Locked = False
ActiveSheet.Protect Password:=&quot;2Tough&quot;
ActiveCell.Offset(, 1).Activate
Exit Sub
Else
Job_Function.ListBox1.RowSource = &quot;&quot;
' Add some items to the ListBox
With Job_Function.ListBox1
.RowSource = &quot;&quot;
.AddItem &quot;1&quot;
.AddItem &quot;2&quot;
.AddItem &quot;3&quot;
.AddItem &quot;4&quot;
.AddItem &quot;5&quot;
.AddItem &quot;6&quot;
.AddItem &quot;7&quot;
.AddItem &quot;8&quot;
.AddItem &quot;9&quot;
.AddItem &quot;10&quot;
.AddItem &quot;11&quot;
.AddItem &quot;12&quot;
.AddItem &quot;13&quot;
.AddItem &quot;14&quot;
.AddItem &quot;15&quot;
.AddItem &quot;16&quot;
.AddItem &quot;17&quot;
.AddItem &quot;18&quot;
.AddItem &quot;19&quot;
.AddItem &quot;20&quot;
.AddItem &quot;21&quot;
.AddItem &quot;22&quot;
.AddItem &quot;23&quot;
.AddItem &quot;24&quot;
.AddItem &quot;25&quot;
.AddItem &quot;26&quot;
.AddItem &quot;27&quot;
.AddItem &quot;28&quot;
.AddItem &quot;29&quot;
.AddItem &quot;30&quot;
.AddItem &quot;31&quot;
End With

Call Decide2

End If
Else
Job_Function.ListBox1.RowSource = &quot;&quot;
' Add some items to the ListBox
With Job_Function.ListBox1
.RowSource = &quot;&quot;
.AddItem &quot;1&quot;
.AddItem &quot;2&quot;
.AddItem &quot;3&quot;
.AddItem &quot;4&quot;
.AddItem &quot;5&quot;
.AddItem &quot;6&quot;
.AddItem &quot;7&quot;
.AddItem &quot;8&quot;
.AddItem &quot;9&quot;
.AddItem &quot;10&quot;
.AddItem &quot;11&quot;
.AddItem &quot;12&quot;
.AddItem &quot;13&quot;
.AddItem &quot;14&quot;
.AddItem &quot;15&quot;
.AddItem &quot;16&quot;
.AddItem &quot;17&quot;
.AddItem &quot;18&quot;
.AddItem &quot;19&quot;
.AddItem &quot;20&quot;
.AddItem &quot;21&quot;
.AddItem &quot;22&quot;
.AddItem &quot;23&quot;
.AddItem &quot;24&quot;
.AddItem &quot;25&quot;
.AddItem &quot;26&quot;
.AddItem &quot;27&quot;
.AddItem &quot;28&quot;
.AddItem &quot;29&quot;
.AddItem &quot;30&quot;
.AddItem &quot;31&quot;
End With

Call Decide2

Exit Sub
End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top