Error from VB excel macro code - msxml3.dll -2146697211 The system cannot locate the resource specif
来源:互联网 发布:淘宝开店在哪里注册 编辑:程序博客网 时间:2024/05/23 12:42
I am using an MSXML.HTTPRequest object in a VB macro (excel) to communicate with an HTTP server. The problem is that it throws the following error intermittently.
msxml3.dll -2146697211 The system cannot locate the resource specified.
I noticed on my system that this happened when the network was down, but my client has complained of it happening intermittently on his machine. Given that his system has Windows 7 installed and it is working at times, I don't think it is an issue of the correct library not being installed. He has tried it on a few networks, but it still fails.
Function xmlHTTPPost(strURL, strData) Dim objHttp On Error Resume Next xmlHTTPPost = "" Set objHttp = CreateObject("Microsoft.XMLHTTP") If Err.Number <> 0 Then Err.Clear Set objHttp = CreateObject("MSXML2.XMLHTTP") End If If Err.Number <> 0 Then MsgBox "Error creating XMLHTTP object" Err.Clear Exit Function End If objHttp.Open "GET", strURL, False If Err.Number <> 0 Then Err.Clear Set objHttp = Nothing Exit Function End If objHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" objHttp.setRequestHeader "User-Agent", "Mozilla Compatible (MS IE 3.01 WinNT)" objHttp.Send If Err.Number <> 0 Then MsgBox "Error " & Hex(Err.number) & " sending to server:" & vbCrLf & Err.description xmlHTTPPost = "ERROR: " & Err.Source & " " & Err.Number & " " & Err.Description Err.Clear Else xmlHTTPPost = objHttp.responseText End If Set objHttp = NothingEnd Function
It's working perfectly on my box, which is a Windows 7 + Microsoft Office 2007 installation.
I have searched a lot online, and two reasons have been vaguely mentioned.
- Network issues due to proxy or firewall. In this case it should never connect, not intermittently.
- Library installation issue. Again, it shouldn't work at all but that's not the case.
I would really appreciate any help on this.
Answers
For now I was able to solve this by changing the method from GET to POST. The error was intermittent but fortunately it started showing up on my dev machine once, and changing the HTTP method to POST did the trick. It's very odd that should happen though, but it worked.
- Error from VB excel macro code - msxml3.dll -2146697211 The system cannot locate the resource specif
- msxml3.dll 错误 '800c0008' The system cannot locate the resource specified.的解决方案
- 解决:Cannot load ocl.dll library(error code 126). The ocil.dll library may be missing from the system
- nginx: [error] OpenEvent("Global\ngx_reload_5988") failed (2: The system cannot find the file specif
- Error code 2: The system cannot find the file specified.
- Error code:1728 Cannot load from mysql.proc. The table is probably corrupted
- (Error:The system cannot find the file specified)用C#生成.dll 供VB6的开发人员调用
- Failed to locate: "CL.exe". The system cannot find the file specified.
- msxml3.dll 错误 80072ee2解决方法 The operation timed out
- msxml3.dll 错误 '80072ee2'The operation timed out
- Cannot find the dll error in my IIS server.
- The Qt Resource System(转)
- visual studio2017解决问题:Cannot find the resource compiler dll rcdll.dll
- virtualbox错误:Qt WARNING: Qt: Session management error: None of the authentication protocols specif
- ... or one of its dependencies. The system cannot find the file specified... 加载指定dll失败
- Cannot Start VS.NET IDE: MSXML3.dll
- Fixed: The Windows Process Activation Service service terminated with the following error: The system cannot find the file speci
- redis-2.8.9 cannot get a resource from the pool caused by 连接拒绝
- HDU 3861 The King’s Problem 连通分量+二分匹配
- uuid的生成
- HDU 4532
- 爬虫程序定时执行和监控示例
- 下一代大数据系统和4S标准
- Error from VB excel macro code - msxml3.dll -2146697211 The system cannot locate the resource specif
- Spring MVC程序中得到静态资源文件css,js,图片 文件的路径
- Android 短信发送接收笔记
- mysql 5.7安装
- /bin/bash^M: bad interpreter: No such file or directory
- 显示毛玻璃效果图片
- form表单只提交数据,不跳转,在struts2中的应用
- Android学习笔记:线性布局LinearLayout
- 剔除list中相同的结构体数据