Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open MS Access in Runtime using Excel VBA?

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

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

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.

Any help is appreciated, thank you

like image 284
Ana Avatar asked Oct 30 '22 11:10

Ana


1 Answers

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)

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.

like image 186
KevenDenen Avatar answered Nov 15 '22 07:11

KevenDenen