Results 1 to 4 of 4
  1. #1
    www is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    17

    Open ArcMap from a button in GIS

    Hi,

    I am trying to use a button in Access to open a GIS map, but this is new to me. My code is:



    Private Sub Command48_Click()
    Shell "ArcMap.exe J:\GISProjects\Irrigated Lands\SpecialProjects\18_GrowerParticipation\onfar mtest.mxd", vbNormalFocus
    End Sub

    When I use the button, I get an error "Run-time error '53': File not found" Any help sorting this out would be appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    give the FULL path to ArcMap

    call shell ("c:\program files\ArcMap.exe J:\GISProjects\Irrigated Lands\SpecialProjects\18_GrowerParticipation\onfar mtest.mxd", vbNormalFocus)

  3. #3
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,165
    You need quotes around your filename because there are spaces in it. Also it may not hurt to use the full path to the ArcMap.exe, if it has spaces in the path then put it in quotes too.

    Code:
    Shell "ArcMap.exe ""J:\GISProjects\Irrigated Lands\SpecialProjects\18_GrowerParticipation\onfar mtest.mxd""", vbNormalFocus

  4. #4
    www is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    17
    Thank you, I combined both suggestions and got it to work.

    Thanks again.

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

Similar Threads

  1. Button to open pdf, VBA
    By dweekley in forum Access
    Replies: 3
    Last Post: 05-11-2017, 12:21 PM
  2. Replies: 3
    Last Post: 10-20-2014, 03:25 PM
  3. Replies: 1
    Last Post: 05-31-2013, 08:53 AM
  4. Button to open certain tab
    By LukeJ Innov in forum Forms
    Replies: 2
    Last Post: 05-10-2013, 07:07 AM
  5. Open a second db from a cmd button
    By Rick West in forum Access
    Replies: 3
    Last Post: 05-12-2010, 08:44 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