+ Reply to Thread
Results 1 to 2 of 2

Open Access Database with VBA

  1. #1
    Bubba
    Guest

    Open Access Database with VBA

    I want to open a specific Access DB from and Excel button. I tried a
    previous sugestion in this forum and It would bring up access but not the
    file. Here is what I have: (I'm so colse to being happy!)


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


  2. #2
    Bubba
    Guest

    RE: Open Access Database with VBA

    User Error....It works

    "Bubba" wrote:

    > I want to open a specific Access DB from and Excel button. I tried a
    > previous sugestion in this forum and It would bring up access but not the
    > file. Here is what I have: (I'm so colse to being happy!)
    >
    >
    > Sub test()
    > On Error Resume Next
    > Set ac = GetObject(, "Access.Application")
    > If ac Is Nothing Then
    > Set ac = GetObject("", "Access.Application")
    > ac.OpenCurrentDatabase "c:\data\temp\temp.mdb"
    > ac.UserControl = True
    > End If
    > AppActivate "Microsoft Access"
    > End Sub
    >


+ 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