Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Keith
 
Posts: n/a
Default Open Access Database with VBA


I have created a macro in an Excel workbook to do various things with a web
query, then export one sheet of the workbook as a txt file. I then get the
macro to open Access.

What I am wanting to do is:- I want my macro to, not only open Access, but
to open a specific Access Database and if possible, run a macro within that
database to import the data that I have exported from Excel.

Any ideas?

Thanks


  #2   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Try this Keith

Sub test()
On Error Resume Next
Set ac = GetObject(, "Access.Application")
If ac Is Nothing Then
Set ac = GetObject("", "Access.Application")
ac.OpenCurrentDatabase "C:\testing.mdb"
ac.UserControl = True
End If
AppActivate "Microsoft Access"
End Sub


I never try to open a macro in Access ?


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Keith" wrote in message ...

I have created a macro in an Excel workbook to do various things with a web query, then export one sheet of the workbook as a txt
file. I then get the macro to open Access.

What I am wanting to do is:- I want my macro to, not only open Access, but to open a specific Access Database and if possible, run
a macro within that database to import the data that I have exported from Excel.

Any ideas?

Thanks



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Importing Data from an Access Database Including a Hyperlink Colum B.C.Lioness Excel Discussion (Misc queries) 0 May 16th 05 05:26 PM
Excel cannot open Access MDB Neva Excel Discussion (Misc queries) 0 April 4th 05 08:35 PM
Open Access Database under and Excel window using a Macro BMSpell Excel Worksheet Functions 1 January 8th 05 05:32 PM
How to use a Access Query that as a parameter into Excel database query Karen Middleton Excel Discussion (Misc queries) 1 December 13th 04 07:54 PM
i want to open database exclusively Carlita Siew Excel Discussion (Misc queries) 3 December 5th 04 05:24 AM


All times are GMT +1. The time now is 08:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"