如何使用Excel VBA在运行时中打开MS Access? [英] How to open MS Access in Runtime using Excel VBA?

查看:187
本文介绍了如何使用Excel VBA在运行时中打开MS Access?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在努力从Excel文件中使用VBA打开MS Access Runtime.

I'm struggling on how to open MS Access Runtime using VBA, from an Excel file.

您可以使用CreateObject("Access.Application")打开完整版的Access,但这不会在运行时中打开Access.

You can open the full version of Access using CreateObject("Access.Application"), but that doesn't open Access in Runtime.

我们仅在某些计算机上安装了Microsoft Access Runtime,因为这是使用我们开发的前端所需的全部.因此,我们需要使用MS Access Runtime(但从Excel中)打开accdb文件.

We only have Microsoft Access Runtime installed in some computers, because that's all we need to use the front-ends we've developed. So we need to open the accdb files using MS Access Runtime, but from Excel.

感谢您的帮助,谢谢

推荐答案

您可以使用命令行管理程序打开文件,就像在Windows的命令提示符中键入该命令一样.

You can use the Shell to open a file, as if you typed that command into window's command prompt.

d = Shell("pathToFile\Database1.accdb /runtime", vbNormalFocus)

您可以用来在运行时打开文件的另一个选项(如果有人从文件夹中打开文件,或者通过其他方法打开了文件,而没有使用/runtime开关)将文件扩展名更改为.accdr.这将始终强制运行.

Another option you could use to open in the file in runtime (if someone opens it from the folder or through some other method without the /runtime switch) would be to change the file extension to .accdr. This will always force runtime.

这篇关于如何使用Excel VBA在运行时中打开MS Access?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆