excel模版从xp复制到win7系统后出现错误 运行时错误 '429' ActiveX 部件不能创建对象
运行时错误 '429' ActiveX 部件不能创建对象
Set objDialog = CreateObject("UserAccounts.CommonDialog")
解决办法
把
Set objDialog = CreateObject("UserAccounts.CommonDialog")
objDialog.Filter = "Access文件(*.mdb)|*.mdb|所有文件(*.*)|*.*"
blnFile = objDialog.ShowOpen
If blnFile Then
strLoadFile = objDialog.Filename
'MsgBox strLoadFile
End If
Set objDialog = Nothing
替换为
Dim IE: Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = False
.Navigate ("about:blank")
Do Until .ReadyState = 4: Loop
With .Document
.Write "<html><body><input id='f' type='file'></body></html>"
With .All.f
.Focus
.Click
strLoadFile = .Value
End With
End With
.Quit
End With
Set IE = Nothing
参考文档
http://www.cnblogs.com/abinxm/archive/2010/06/21/1762028.html
http://wangye.org/blog/archives/551/
IE需要设置:
工具 – Internet选项 – 安全 – 自定义级别 – 找到“其他”中的“将本地文件上载至服务器时包含本地目录路径”,选中“启用”即可。
最新文章
- 安卓自定义组合控件--toolbar
- css实现小三角(原理)
- PHP 可变长度参数列表
- 在MACOS上实现交叉编译
- #pragma section
- 4.跟我学solr---SolrRequestHandler具体解释
- MC34063+MOSFET扩流 12V-5V 折腾出了高效率电路(转)
- 在Spring MVC Controller的同一个方法中,根据App还是WEB返回JSON或者HTML视图。
- 11.并发包阻塞队列之LinkedBlockingQueue
- String类的简要概述(1)
- 使用newtonsoft序列化
- (hdu)4858 项目管理 (vector)
- Python列表操作集合
- (计算几何 线段判交) 51nod1264 线段相交
- Codeforces 1045G AI robots [CDQ分治]
- 关于SUID SGID
- [cb]ScriptableWizard 创建向导
- ASP.NET MVC 4 中的JSON数据交互
- SparkContext.union 与 RDD.union
- LeetCode——12. Integer to Roman