满足条件时如何在VBA中播放wav声音文件?

时间:2018-09-11 11:03:26

标签: excel vba excel-vba audio wav

我正在处理VBA表单,用户需要在其中传递如下所示的ComboBox条件-

Private Sub ComboBox4_AfterUpdate()
    Dim ws As Worksheet
    Set ws = Worksheets("PRODUCT")

    Fnsearch = ComboBox4.Value
    Set searchRange = ws.Range("B:B")
    Set foundCell = searchRange.Find(What:=Fnsearch, After:=searchRange.Cells(searchRange.Cells.Count))

    If Not foundCell Is Nothing Then
        ' Doing some form work
        ' And want play notification sound here for user
    Else
        ' Want play notification sound here for user
        rslt = MsgBox("Kindly check product name which you typed." & vbCr & _
                      "Because this Item is not available in PRODUCT page." & vbCr & vbCr & _
                      "Kindly click Yes to Add Product or No to Discard.", vbYesNo, "Product not exists")
        If rslt = vbYes Then
            AddPartyA.Show
        End If
    End If
End Sub

0 个答案:

没有答案