Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Optional parameters must specify a default value

Optional parameters must provide default values that can be used if no parameter is supplied by a calling procedure.

Error ID: BC30812

To correct this error

  • Specify default values for optional parameters; for example:

    Sub Proc1(ByVal X As Integer, 
          Optional ByVal Y As String = "Default Value")
       MsgBox("Default argument is: " & Y)
    End Sub
    
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft