Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2002
    Location
    Bay Area
    Posts
    511

    Unanswered: Start Access from Excel VBA Without Displaying Message

    I need a solution to run an Access 2003 application from Excel VBA and bypass the Access security warning that says This file may not be safe...etc. The problem is that the security warning is an annoyance in a program that is intended to "invisibly" do the Access processing.

    Here is the VBA code I am using from Excel. It does run the macro.

    Code:
    Function Open_Access_App()
    
        Dim appAccess As Object
        Set appAccess = CreateObject("Access.Application.11")
    
        Application.ScreenUpdating = False
        Application.DisplayAlerts = False
        
        Set appAccess = GetObject("C:\Data\" _
          & "\MyDatabase.MDB")
        
        With appAccess
            .DoCmd.RunMacro ("TestMacro")
        End With
        
        Set appAccess = Nothing
            
    End Function
    Thanks.
    Jerry

  2. #2
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Go to google or Dogpile and enter the search string:

    +Access 2003 +This file may not be safe

    and you'll get a gazillion hits explaining what to do. Basically you have to handle this thru Access.

    BTW, this is the second time I've posted this response to ths question and it disappeared. This the third response I've posted in the last two days that vanished! Anyone have any idea what's going on?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Join Date
    Jan 2002
    Location
    Bay Area
    Posts
    511
    One of the solutions on a web page titled Conrad Systems Development included VB code to set the security level to Low. This works well on my non-shared database.

    I can now open Access from Excel and suppress the Access Security Warning dialog box.

    Jerry

  4. #4
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Glad you solved your problem. That's a pretty interesting site; I've bookmarked it for future reference!
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    Join Date
    Feb 2004
    Location
    Irving, TX (Dallas, Fort Worth)
    Posts
    379

    Good Site

    Yes the CSD site is great. I followed some of the hints and close my DB with the "Docmd.Quit", but doesn't always work.

    Any other better or subsequent ideas?

    DBS4M

  6. #6
    Join Date
    Jun 2007
    Posts
    33
    Hi there,
    try "Application.quit"

  7. #7
    Join Date
    Jun 2005
    Location
    Richmond, Virginia USA
    Posts
    2,763
    Provided Answers: 19
    Where are you placing DoCmd.Quit?
    Hope this helps!

    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Docmd.Quit has always worked for me.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

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