Results 1 to 4 of 4
  1. #1
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127

    Open External program with vba


    Hi guys
    I am trying to open an a file with an external application.
    Code:
    Shell Chr(34) & "C:\Windows\System32\mspaint.exe" & Chr(34) & " " & _
    Chr(34) & strFilePath & Chr(34), 1
    I am using the above code to open paint. and when I change the App path to open another program its not working. Invalid procedure or call argument. The program is. AdobePhotoshopExpress
    Its a free app I downloaded from store windows 8.1
    and here is the path
    Code:
    Code:
    Shell Chr(34) & "C:\Program Files\WindowsApps\AdobeSystemsIncorporated.AdobePhotoshopExpress_1.2.0.20_x64__ynb6jyjzte8ga\psexpress.exe" & Chr(34) & " " & _
    Chr(34) & strFilePath & Chr(34), 1
    Both paths I copied from task manager.
    Any help would be apreciated
    Can some one please help me solve this?
    Thank you

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I would first test it in the Run window and then transfer what worked there to VBA. Considering the error, I would guess the app is having trouble finding the path to your file. So I would first test.

    Code:
    C:\Program Files\WindowsApps\AdobeSystemsIncorporated.AdobePhotoshopExpress_1.2.0.20_x64__ynb6jyjzte8ga\psexpress.exe
    After I was successful there I would then move to

    Code:
    C:\Program Files\WindowsApps\AdobeSystemsIncorporated.AdobePhotoshopExpress_1.2.0.20_x64__ynb6jyjzte8ga\psexpress.exe "C:\FolderName\FileName.extension"

  3. #3
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    I often have trouble using Shell and then have to use ShellExecute - more complicated but seems to always work. I don't have an example for you but I am sure you can google it.

  4. #4
    aspen is offline Competent Performer
    Windows Vista Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    127
    Quote Originally Posted by aytee111 View Post
    I often have trouble using Shell and then have to use ShellExecute - more complicated but seems to always work. I don't have an example for you but I am sure you can google it.
    Whwn I run it in windows It seems that the publisher is unknown. when I press open anny way I get this massage
    Attached Thumbnails Attached Thumbnails Untitled.png  

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

Similar Threads

  1. Replies: 4
    Last Post: 04-01-2014, 03:56 PM
  2. Open an external folder specific by a form field
    By AccessNoob16 in forum Forms
    Replies: 11
    Last Post: 04-09-2012, 01:30 PM
  3. Replies: 1
    Last Post: 02-08-2012, 01:33 PM
  4. Open (shell) a program and pass a file
    By Olszanski in forum Programming
    Replies: 2
    Last Post: 07-27-2010, 03:52 PM
  5. Replies: 4
    Last Post: 05-20-2010, 03:49 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