VBA to send an IM using skype for business RRS feed

  • Question

  • Guys

    I am desperately trying to create an script that will allow me to send an im from excel using Skype for business.

    I found the below but it doesn't work :(

    Basically I have a sheet with 10 rows, the contacts email/Skype id are in cell D3 to d12, I want an individual message to each saying(eg for row 3)  "you currently have [value of cell c3] sales"

    I am happy to create 10 separate module for each row or if it can be combined then even better :)

    Thanks in advance


    Sub sendIM()
    Dim msgr As CommunicatorAPI.IMessengerConversationWndAdvanced
     Dim ToUser As String
     Dim message As String
    Application.ScreenUpdating = False
    ToUser = “”
    message = “test vba communicator”
    On Error Resume Next
     Set msgr = Messenger.InstantMessage(ToUser)
     'Send message to window
    msgr.SendText (message)
    Application.ScreenUpdating = True
    End Sub

    Tuesday, January 12, 2016 12:58 PM

All replies

  • Hi dude_sweet7,

    This forum is for Developer discussions and questions involving Microsoft Excel, your issue is related with skype developing, I will move this thread to the more related forum.


    Thanks for your understanding.

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 13, 2016 5:22 AM
  • Hi Edward - thanks for the reply however this is re excel as I need a VB script that will run the above from a spreadsheet I have in excel.


    Wednesday, January 13, 2016 3:07 PM
  • Lync 2013/SfB 2015 does not expose COM entry points that Excel can use.

    You can create a wrapper around the Lync 2013 SDK and expose some COM objects that could be used from Excel.

    Thursday, January 14, 2016 3:26 AM
  • Can you please  provide me code for sending message from excel vba to Skype for business 

    below code is not working for me 

    Sub testingskype()
    Dim aSkype As SKYPE4COMLib.Skype
    Set aSkype = New SKYPE4COMLib.Skype
    Dim oChat As Chat
    Dim skUser As SKYPE4COMLib.User
        Set skUser = aSkype.User("")
        Set oChat = aSkype.CreateChatWith(skUser.Handle)
        oChat.SendMessage "hello.....testing"
    End Sub

    I am getting error as  Run-time error '-2147220991(80040201); wait time out

    I have added the SKYPE4COMLib  reference in my VBA project

    this issue is because of I am using SKYPE for business  

    SKYPE4COMLib dll cannot invoke   SKYPE for business

    can you please help me for solve this issue
    Sunday, February 3, 2019 9:30 AM
  • Hi Chris,

    can you please get  me some code sample for the mentioned wrapper around  Lync 2013 SDK

    • Edited by OKRAGESH Tuesday, February 5, 2019 1:20 PM
    Tuesday, February 5, 2019 1:13 PM