1
Sub prelim()
    MsgboX "Hello World"
End Sub


Sub Main()
    Call prelim
End Sub

In the above code Sub prelim can't be edited.I want msgbox when I run Sub prelim but when I run Sub Main I don't want the message box to get popped out. How to do it?

Kosmo
  • 59
  • 1
  • 10

1 Answers1

6

This is not possible without changing Sub prelim

Sub prelim(Optional silent As Boolean = True)
    If Not silent Then MsgBox "Hello World"
End Sub


Sub Main()
    prelim True   'no msgbox
    prelim False  'with msgbox
    prelim        'no msgbx
End Sub
Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73