ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Open a access database using VBA (https://www.excelbanter.com/excel-programming/341681-open-access-database-using-vba.html)

Kryer

Open a access database using VBA
 
I already know how to open an instance of Access using the
application.ActivateMicrosoftApp = xlMicrosoftAccess. But what I havent been
able to get is a way to just open a specific database from excel vba. I dont
want to edit data from access to excel or vice versa. I just want a button
that says start this specific database. The data base is stored under
"C:\Data\Access\CustomerCare.mdb". Is any one able to help me with this.

R. Choate

Open a access database using VBA
 
What are you trying to do? That will help avoid giving you an answer you don't want. I can give you ADO code for opening an instance
of a specific db from Excel, but the purpose of the code is to run a query against data in the db and bring it over to Excel. You
seem to be saying you don't want that. You also don't seem to want the database to just open up and appear on the screen, but I
can't tell.

--
RMC,CPA


"Kryer" wrote in message ...
I already know how to open an instance of Access using the
application.ActivateMicrosoftApp = xlMicrosoftAccess. But what I havent been
able to get is a way to just open a specific database from excel vba. I dont
want to edit data from access to excel or vice versa. I just want a button
that says start this specific database. The data base is stored under
"C:\Data\Access\CustomerCare.mdb". Is any one able to help me with this.



William Benson[_2_]

Open a access database using VBA
 
Try Windows scripting maybe:


Sub test()
Dim objshell As Object

Set objshell = CreateObject("Wscript.Shell")
objshell.Run """C:\Program Files\Microsoft Office\Office11\MSAccess.exe"" "
& _
"""C:\Program Files\Microsoft Office\Office11\Samples\Northwind.mdb""",
1, False

If Err.Number Then
Wscript.Echo "Some horrible error: " & Err.Number & " (" &
Err.Description & ")"
End If

End Sub



"Kryer" wrote in message
...
I already know how to open an instance of Access using the
application.ActivateMicrosoftApp = xlMicrosoftAccess. But what I havent
been
able to get is a way to just open a specific database from excel vba. I
dont
want to edit data from access to excel or vice versa. I just want a button
that says start this specific database. The data base is stored under
"C:\Data\Access\CustomerCare.mdb". Is any one able to help me with this.





All times are GMT +1. The time now is 09:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com