Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Posts
    19

    Unanswered: Access mAcro not executing from vbscript

    hi,

    I have run access macro from vbscript on several occasions, but this time around it is not working

    set objaccess = createobject("Access.application")
    objaccess.opencurrentdatabase ("E:\AO_VERIFICATION\AO.mdb")
    objaccess.run "AO"
    objaccess.CloseCurrentDatabase
    set objaccess=nothing

    the macro name is AO, and the access patch is also correct..

    Error :...cant find procedure AO..ANY SUGGESTIONS???..THANKS

  2. #2
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Try it like this.
    Sub RunExternalMacro()
    Dim objAccess As New Access.Application
    With objAccess
    .OpenCurrentDatabase "F:\Access\YourDB.mdb"
    .DoCmd.RunMacro "Macro1"
    .CloseCurrentDatabase
    End With
    End Sub

  3. #3
    Join Date
    Dec 2004
    Posts
    19

    Hi

    hi thanks it works

Posting Permissions

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