zoukankan      html  css  js  c++  java
  • 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选项 – 安全 – 自定义级别 – 找到“其他”中的“将本地文件上载至服务器时包含本地目录路径”,选中“启用”即可。

  • 相关阅读:
    手动安装mysql-5.0.45.tar.gz
    Hadoop2.5.2+HA+zookeeper3.4.6详细配置过程
    大数据分析之技术框架整理
    docker安装
    CentOS 6.8安装Docker V1.0
    处理百万级的数据
    剑指 Offer 32
    剑指 Offer 32
    剑指 Offer 32
    剑指 Offer 31. 栈的压入、弹出序列
  • 原文地址:https://www.cnblogs.com/slyzly/p/4240933.html
Copyright © 2011-2022 走看看