Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have a database that I created in Access 2002 that used a macro to start an application. It worked fine.

    I moved the database to Access 2007 and now the code will not work.

    I had the following code set to run as a run code event

    Shell("C:\Program Files\Winnebago\Spectrum Client\pcat32t.exe")

    Any suggestions on what event to use or how to change the code.

    Thanks.

    Paul

  2. #2
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Have you created a Trusted Location for your database? Access 2007 requires that the database be in such a folder - click the Office button and then choose Access Options and Trust Center and Choose Trust Center. Then click Trust Center Settings.
    Wendell

  3. #3
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I added a trusted location but the code still does not work.. Error message 2950

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    Are you sure the error is coming from the Access 2007 database and not from the Spectrum product. I have limited experience with Spectrum, but what I have had isn't very favorable. We had all sorts of problems trying to run it on a 64-bit Win7 workstation for example. Are you able to start it manually with that shortcut?
    Wendell

  5. #5
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The problem is not Sprectrum. I can paste the commnad line in the run box and it works.

    I think it has something to do with the Run Code command. Is there some type run App command?

  6. #6
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts
    I take it you are trying to run this from a macro rather than a VBA module. The problem is the Shell() function wants to return a value that indicates whether or not the command was successful. Try running it from VBA and check to see if it is returning a success value.
    Wendell

  7. #7
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can you help me with the VBA code. Here is the command line. I have never tried to do it this way.

    C:\Program Files\Winnebago\Spectrum Client\pcat32t.exe

    Thanks.

    Paul

  8. #8
    5 Star Lounger AndrewKKWalker's Avatar
    Join Date
    Apr 2001
    Location
    Cambridge, UK
    Posts
    1,020
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Code:
    Dim varProgID
    
    varProgID=Shell("C:\Program Files\Winnebago\Spectrum Client\pcat32t.exe")
    If you want to see if shell reports back temporarily you can add

    msgbox "Program ID Returned was .... " & varProgID
    Andrew

  9. #9
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That worked.

    Thanks so much!

    Paul

Posting Permissions

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