+ Reply to Thread
Results 1 to 3 of 3

Use excel vba to Call macro from Access

  1. #1
    Registered User
    Join Date
    07-06-2006
    Location
    Amsterdam
    Posts
    20

    Use excel vba to Call macro from Access

    Hi, guys,

    I have a macro in Access which execute the query. I want to set up an automatic file in excel so that I can call the macro in access as well. Any one can help me?

  2. #2
    Registered User
    Join Date
    07-06-2006
    Location
    Amsterdam
    Posts
    20

    No one has any idea?

    No one has any idea?

  3. #3
    Chip Pearson
    Guest

    Re: Use excel vba to Call macro from Access

    Try code like the following. You'll need a reference to Access
    (VBA, Tools menu, References).

    Dim Acc As Access.Application
    On Error Resume Next
    Set Acc = GetObject(, "Access.Application")
    If Acc Is Nothing Then
    Set Acc = CreateObject("Access.Application")
    If Acc Is Nothing Then
    MsgBox "cannot get access"
    Exit Sub
    End If
    End If
    On Error GoTo 0

    Acc.OpenCurrentDatabase "H:\db2.mdb"

    Acc.Run "AAA"


    --
    Cordially,
    Chip Pearson
    Microsoft MVP - Excel
    Pearson Software Consulting, LLC
    www.cpearson.com




    "ppyxl" <ppyxl.2aizw1_1152192604.2904@excelforum-nospam.com>
    wrote in message
    news:ppyxl.2aizw1_1152192604.2904@excelforum-nospam.com...
    >
    > Hi, guys,
    >
    > I have a macro in Access which execute the query. I want to set
    > up an
    > automatic file in excel so that I can call the macro in access
    > as well.
    > Any one can help me?
    >
    >
    > --
    > ppyxl
    > ------------------------------------------------------------------------
    > ppyxl's Profile:
    > http://www.excelforum.com/member.php...o&userid=36116
    > View this thread:
    > http://www.excelforum.com/showthread...hreadid=558875
    >




+ 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