Is there a way to send messages via Skype for Business using excel VBA?
I tried to add SKYPE4COMLib and following code:
Sub skype()
Dim aSkype As SKYPE4COMLib.skype
Set aSkype = New SKYPE4COMLib.skype
Dim oChat As Chat
Dim skUser As SKYPE4COMLib.user
Set skUser = aSkype.user("user_name")
Set oChat = aSkype.CreateChatWith(skUser.Handle)
oChat.OpenWindow
oChat.SendMessage "automated message"
End Sub
But it is not working :(
Is it even possible?
Thank you very much!
Please keep noted that there are two products:
- Skype for Business (SfB) [former known as Lync]
- Skype for Consumer (SfC)
both products can be used for chat & calls (VOIP) however they are not the same products. SfB is mostly used for companies where SfC is mostly used for consumer as you can download the client here for free and can as well use some features from SfC for free.
The Skype4com.lib is only compatible with SfC and not with SfB. This is due to the reason that Lync 2013/SfB 2015 does not expose COM entry points that Excel can use (see here). If you wish to send chats with SfB you should check UCWA 2.0.