Results 1 to 2 of 2
  1. #1
    bravura is offline Novice
    Windows 10 Access 2013 32bit
    Join Date
    Nov 2016
    Posts
    2

    Call Access Macro using Excel

    I want to provide a dashboard to my team and give them buttons to pull reports out of access database. having problems calling macro in module.

    please help. and thank you just for reading.

    Module name: ExtReprts
    Macro: Sub Reports(intReportType)



    Dim appAccess As Access.Application
    Set appAccess = New Access.Application
    Dim filepath As String
    filepath = "\\\mydatabase.mdb"


    With appAccess
    .OpenCurrentDatabase (filepath) 'prefer to connect without opening.


    .Visible = True 'necessary?
    .DoCmd.OpenModule "ReportsExternal", "Reports" 'so far, so good
    DoCmd.RunMacro ("Reports(0)") 'errors out - mydatabase cannot find the object 'Reports'
    End With

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Never tried this, but I'd point out that you don't have the "." at the beginning of that line, so it's not running the Access macro, it's trying to find an Excel macro.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 02-25-2015, 04:50 PM
  2. Replies: 1
    Last Post: 01-13-2015, 01:33 PM
  3. Access macro vs. excel macro
    By twckfa16 in forum Macros
    Replies: 3
    Last Post: 01-07-2015, 03:44 PM
  4. Replies: 0
    Last Post: 05-07-2009, 02:32 PM
  5. Call Excel Data into Access table
    By jiguvaidya in forum Import/Export Data
    Replies: 0
    Last Post: 09-15-2008, 04:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums