|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
- Sub Test1() '全部发送成功
- Dim obj As Object
- Set obj = CreateObject("WeChatTool.WeChatClass")
- obj.SendMessage "", "文件传输助手", "信息发送测试!"
- obj.SendMessage "", "联系人1", "信息发送测试!"
- obj.SendMessage "", "联系人2", "信息发送测试!"
- obj.SendMessage "", "联系人3", "信息发送测试!"
- obj.SendMessage "", "联系人4", "信息发送测试!"
- End Sub
- Sub Test2()
- Dim obj As Object, T&
- Set obj = CreateObject("WeChatTool.WeChatClass")
- obj.SendMessage "", "文件传输助手", "信息发送测试!" '发送成功
- T = Timer: While Timer - T < 5: DoEvents: Wend
- obj.SendMessage "", "联系人1", "信息发送测试!" '发送失败,Log文件提示:查找通讯录按钮失败!
- T = Timer: While Timer - T < 5: DoEvents: Wend
- obj.SendMessage "", "联系人2", "信息发送测试!" '发送成功
- T = Timer: While Timer - T < 5: DoEvents: Wend
- obj.SendMessage "", "联系人3", "信息发送测试!" '发送失败,Log文件提示:查找通讯录按钮失败!
- T = Timer: While Timer - T < 5: DoEvents: Wend
- obj.SendMessage "", "联系人4", "信息发送测试!" '发送成功
- End Sub
- Sub Test3()
- '第1、3、5、7、9条信息发送成功
- '第2、4、6、8、10条信息发送失败,Log文件提示:查找通讯录按钮失败!
- Dim obj As Object, i%, T&
- Set obj = CreateObject("WeChatTool.WeChatClass")
- For i = 1 To 10
- If i <> 1 Then
- T = Timer: While Timer - T < 5: DoEvents: Wend
- End If
- obj.SendMessage "", "文件传输助手", "信息发送测试" & i
- Next i
- End Sub
复制代码
上述代码,将
Dim obj As Object
Set obj = CreateObject("WeChatTool.WeChatClass")
换成
Dim obj As WeChatTool.WeChatClass
Set obj = New WeChatClass
以后,测试结果完全相同。
还是那句,希望对后续控件的改进能有所帮助。
|
|