5
votes

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

1
Can you clarify what you mean with "in runtime"? Is Access supposed to magically open with a specific database and run a specific macro without you telling it?Mathieu Guindon
Yes - 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.Ana
I'd suggest you edit your question to include that somewhat crucial information.Mathieu Guindon
I'll do that - thank you!Ana
Windows Script Host Object Model WshShell.Exec, or Microsoft Shell Controls and Automation Shell.ShellExecuteZev Spitz

1 Answers

2
votes

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.