+ Reply to Thread
Results 1 to 2 of 2

Open Access Database with VBA

  1. #1
    Keith
    Guest

    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. #2
    Ron de Bruin
    Guest

    Re: Open Access Database with VBA

    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" <[email protected]> wrote in message news:[email protected]...
    >
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1