View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Compile Error "Invalid Outside Procedure"

Hi,

Stop jumping around creating new threads and see my comments in your
previous post. It's the top line here that's giving the compile error, delete
it

BuildDetailReport
Private Sub CommandButton1_Click()

Mike


"Kanmi" wrote:

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