Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I need a Microsoft Excel macro that will open an existing Microsoft Access
database file. I have written a macro that lets me open a new Access file, but can't open an existing file. Please Help. P.S. It would be nice if I could run the macro that exists in Access through excel as well! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this gaitkeeper
Sub test() On Error Resume Next Set ac = GetObject(, "Access.Application") If ac Is Nothing Then Set ac = GetObject("", "Access.Application") ac.OpenCurrentDatabase "C:\My Documents\db1_2K.mdb" ac.UserControl = True End If AppActivate "Microsoft Access" End Sub Sub test2() On Error Resume Next Set xl = GetObject(, "Excel.Application") If xl Is Nothing Then Set xl = GetObject("", "Excel.Application") xl.Workbooks.Open "c:\Data\book1.xls" xl.UserControl = True xl.Visible = True End If AppActivate "Microsoft Excel" End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "gaitkeeper" wrote in message ... I need a Microsoft Excel macro that will open an existing Microsoft Access database file. I have written a macro that lets me open a new Access file, but can't open an existing file. Please Help. P.S. It would be nice if I could run the macro that exists in Access through excel as well! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macros - Open an access file from de Excel? | Excel Discussion (Misc queries) | |||
How can I open an Access adp file from excel? | Excel Discussion (Misc queries) | |||
How can I open an Access adp file from excel? | Excel Discussion (Misc queries) | |||
Trying to open an Excel file from VBA Access | Excel Programming | |||
Open Ms Access database with excel macro | Excel Programming |