自动安装 Comdlg32.ocx?

发布于 2024-11-02 06:13:25 字数 116 浏览 1 评论 0原文

我想要将包含 comdlg32.ocx 组件的表单的 Excel 电子表格分发到网络共享。

Windows 7 用户可能不会安装或注册此组件。有没有办法在 Windows 7 中自动检查并安装该组件?

I'm wanting to distribute an Excel spreadsheet with a form including a comdlg32.ocx component to a networked share.

Windows 7 users likely won't have this component installed or registered. Is there a way to automatically check and then possibly install this component in Windows 7?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

鹤舞 2024-11-09 06:13:25

我曾经有一些代码,它做了一些类似的事情,

on error goto errhandler
try to instantiate an object of type x
we're not in the error handler - the dll must have already been registered! 
continue processing...
exit sub (or whatever)

errhandler:
shell "regsvr.exe /s " & path_to_dll
retry instantiation

如果 regsvr 调用失败,显然你会希望避免进入无限循环。另外,我不建议在网络共享上注册 dll;下次运行宏时它可能不可用。首先尝试将其复制到本地驱动器。

还有一件事需要考虑:您不应该真正复制单个系统 DLL,因为它们是成组发布的,这样做可能会导致版本控制问题。但有时,我也发现冒险并继续前进会更容易。

I once had some code which did something along the lines of

on error goto errhandler
try to instantiate an object of type x
we're not in the error handler - the dll must have already been registered! 
continue processing...
exit sub (or whatever)

errhandler:
shell "regsvr.exe /s " & path_to_dll
retry instantiation

Obviously you'll want to avoid getting into an endless loop if the regsvr call fails. Plus, I wouldn't recommend registering the dll on the network share; it might not be available the next time the macro runs. Try to copy it to the local drive first.

One more thing to consider: You shouldn't really be copying a single system DLL, since they're released in sets and doing so can cause versioning issues. Sometimes, though, I've also found it easier just to take the risk and move on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文