Objective: Send a message to a Skype contact when a certain macro is done.
Sources: I searched around and found a couple of question in SO trying to do the same thing. This is the base for the code I am using Using Excel VBA to send Skype messages to Group Chat and also this https://www.mrexcel.com/forum/excel-questions/424432-sending-skype-message-through-excel-vba.html Both these questions use a similar code.
Issue: When I run the code I get the following error:
Run-time error '429': ActiveX component can't create object
on the line:
Set aSkype = New SKYPE4COMLib.Skype
Question: Is this API still functional for this kind of procedure? How can I solve the ongoing error?
Code:
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("user_name")
Set oChat = aSkype.CreateChatWith(skUser.Handle)
oChat.OpenWindow
oChat.SendMessage "message"
End Sub
Obs: I am using option explicit in every module I create.
This might not be of much help but I do not think the code that you have listed here works or the library is not added into your excel.
The same code turns up here: https://stackoverflow.com/a/43172531/8716187
Did you download and register the skype dll (error has to do with not adding the activeX control it appears). It might only be x32 if you are using x64 ..
When you install software that uses the Skype4COM.dll dependency, the software should automatically register the file for you. In some cases your DLL file may not register properly, and as a result, will provide a "Skype4COM.dll not registered" error. Fortunately, you can use a built-in utility called "Microsoft Register Server" (regsvr32.exe) to re-register your Skype4COM.dll file. How to re-register Skype4COM.dll from an elevated command prompt (Windows XP, Vista, 7, 8, and 10):
Click the Start button.
Type "command" in the search box... DO NOT hit ENTER yet!
While holding CTRL-Shift on your keyboard, hit ENTER.
You will be prompted with a permission dialog box.
Click Yes.
Type the following command: regsvr32 /u Skype4COM.dll.
Hit ENTER. This will UN-REGISTER your file.
Type the following command: regsvr32 /i Skype4COM.dll.
Hit ENTER. This will RE-REGISTER your file.
Close the command prompt window.
Re-start the program associated with Skype4COM.dll error.
https://www.solvusoft.com/en/files/missing-not-found-error/dll/windows/skype-for-com-api/skype4com/skype4com-dll/
Cheers, WWC