Results 1 to 4 of 4

Setting "Current" access database and running macro from Excel

Threaded View

  1. #1
    Registered User
    Join Date
    10-20-2011
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    98

    Setting "Current" access database and running macro from Excel

    I found some code that will open a database with a file name and run an access macro.

    Example:
    Sub AccessTest1()
    Dim A As Object
    Application.DisplayAlerts = False
    Set A = CreateObject("Access.Application")
    A.Visible = False
    A.OpenCurrentDatabase ("Path of your database")
    A.DoCmd.RunMacro "Name of your macro"
    Application.DisplayAlerts = True
    End Sub
    However i would like to skip the opening of a database and simply refer to the database that is currently open on my screen.

    Is this possible?

    Thanks
    Last edited by beat; 12-10-2013 at 04:09 AM. Reason: Shoddy Grammar

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Excel 2010 -- "Visual Basic" "Macros" and "Record Macro" all disabled.
    By NicholasL in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-07-2017, 06:11 AM
  2. [SOLVED] Excel Crashes or Gives "Automation Error" on Mac when running Macro
    By mlj61289 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2013, 04:39 PM
  3. Importing data from Access database to Excel. Dont want headers/"field names".
    By Treenigheden in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2012, 08:35 AM
  4. Replies: 6
    Last Post: 08-09-2006, 08:19 AM
  5. Using Access database to "populate" Excel Sheets
    By maacmaac in forum Excel General
    Replies: 1
    Last Post: 09-19-2005, 01:05 PM

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