none
VBA to send an IM using skype for business

    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

    Tom

    Sub sendIM()
    
    Dim msgr As CommunicatorAPI.IMessengerConversationWndAdvanced
     Dim ToUser As String
     Dim message As String
    
    Application.ScreenUpdating = False
    
    ToUser = “test@test.com”
    message = “test vba communicator”
    
    On Error Resume Next
     Set msgr = Messenger.InstantMessage(ToUser)
    '
     'Send message to window
    '
    msgr.SendText (message)
    msgr.Close
    
    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.

    Reference: https://social.msdn.microsoft.com/Forums/en-US/home?forum=communicatorsdk

    Thanks for your understanding.

    Best Regards,

    Edward


    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.

    Tom

    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("ranya.paraprath@accenture.com")
        Set oChat = aSkype.CreateChatWith(skUser.Handle)
        oChat.OpenWindow
        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