Open Access Database through Excel

G

Guest

I'm new to VB programming in Excel. I've coded VB in Access before but never
in Excel. I don't even know where this would be coded in Excel. I would
like to open an Access Database from Excel but don't where to even begin to
start! Can someone give me some pointers (in simple terms, as I am not
familiar with the excel programming lingo yet). Or even suggest a website
where I can find step by step instructions? I appreciate any assistance that
can be provided!!
 
G

Guest

You can call it a couple of ways...See below.
I prefer using the 'Shell' option. A LOT less messy.
HTH,
Gary Brown

'/===================================/
Sub test_Shell()
Dim strAccessProgramLocation As String
Dim retVal As Variant

'put location of MS Access program in string
strAccessProgramLocation = _
"C:\Program Files\Microsoft Office\Office\msaccess.exe"

'call MS Access from Excel
retVal = Shell(strAccessProgramLocation, vbNormalFocus)

End Sub
'/===================================/
Sub test_App()
'create a reference to...
'Microsoft Access 9.0 Object Library
' Probably located at...
' C:\Program Files\Microsoft Office\Office\MSACC9.OLB
Dim objAccess As Access.Application

Set objAccess = New Access.Application

objAccess.Visible = True

MsgBox "Access Closed"

exit_Sub:
Set objAccess = Nothing
Exit Sub

End Sub
'/===================================/
 
G

Guest

The second method is used when you want to open a particular database or run
a particular query within a database, etc.
HTH,
gary brown
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top