View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Kanmi Kanmi is offline
external usenet poster
 
Posts: 76
Default Compile Error "Invalid Outside Procedure"

Please can anybody help me check this code. When i run it show Compile
Error"Invalid outside procedure" then i removed the "BuildDetailReport" and
re-run and again it show Compile Error " Wrong number of argument or invalide
proprty assignment" then automatic highlight "Call BuildDetailReport". please
advice. Thanks


BuildDetailReport
Private Sub CommandButton1_Click()
ask = MsgBox("Build safety report?", vbYesNo, BoxTitle)
If ask = 7 Then Exit Sub



Select Case Range("D21")
Case "DOWNSTRM":
Set TrainingSht = Sheets("Training_Progress_By_Employee")
Set PersonnelSht = Sheets("Personnel Roster")
Set PersonnelSht = Sheets("Lookup")

Case "OFC":
Set TrainingSht = Sheets("Training_Progress_By_Employee2")
Set PersonnelSht = Sheets("Personnel Roster2")
Set PersonnelSht = Sheets("Lookup2")

End Select



Call BuildDetailReport(TrainingSht, PersonnelSht)
MsgBox "Done", , BoxTitle
End Sub