从Excel向viber发送消息

时间:2020-10-08 17:08:46

标签: excel vba sendkeys

我想使用vba excel将excel与viber连接起来,但是在这段代码中,viber不会使用(ENTER)来打开对话以将消息发送到联系人中选定的电话号码。此代码在whatsapp中有效,但是不在viber中,我如何使此代码在viber中工作?

Dim contact As String

Dim text As String

u = Application.WorksheetFunction.CountA(Sheets("Sheet1").Range("a:a")) - 2

ActiveWorkbook.FollowHyperlink Address:="C:\Users\Acer\AppData\Local\Viber\Viber.exe"

Application.Wait (Now + TimeValue("00:00:12"))



For I = 0 To u

contact = Sheets("Sheet1").Range("b2").Offset(I, 0).Value

text = Sheets("Sheet1").Range("c2").Offset(I, 0).Value

Call SendKeys("{TAB}", True)

Application.Wait (Now + TimeValue("00:00:05"))

Call SendKeys(contact, True)

Application.Wait (Now + TimeValue("00:00:05"))

Call SendKeys("{ENTER}", True)

Application.Wait (Now + TimeValue("00:00:05"))

Call SendKeys(text, True)

Application.Wait (Now + TimeValue("00:00:01"))

Call SendKeys("{ENTER}", True)

Application.Wait (Now + TimeValue("00:00:01"))

Call SendKeys("{TAB}", True)

Next I

请告诉我我在做什么错了。

0 个答案:

没有答案