6

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

11
  • 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? Commented Feb 20, 2017 at 18:50
  • 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. Commented Feb 20, 2017 at 18:53
  • I'd suggest you edit your question to include that somewhat crucial information. Commented Feb 20, 2017 at 18:54
  • I'll do that - thank you! Commented Feb 20, 2017 at 18:55
  • 3
    Windows Script Host Object Model WshShell.Exec, or Microsoft Shell Controls and Automation Shell.ShellExecute Commented Feb 20, 2017 at 19:02

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much! I did something very similar and it's working now CreateObject("WScript.Shell").Run ("""pathToFile\Database1.accdb""")

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.