ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compile Error "Invalid Outside Procedure" (https://www.excelbanter.com/excel-programming/431548-compile-error-invalid-outside-procedure.html)

Kanmi

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


Mike H

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



All times are GMT +1. The time now is 08:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com