Results 1 to 5 of 5

Shell function gives File not Found error

Threaded View

jewelsharma Shell function gives File not... 03-04-2014, 03:12 AM
Izandol Re: Shell function gives File... 03-04-2014, 04:51 AM
jewelsharma Re: Shell function gives File... 03-04-2014, 05:14 AM
Izandol Re: Shell function gives File... 03-04-2014, 05:50 AM
jewelsharma Re: Shell function gives File... 03-04-2014, 09:38 PM
  1. #1
    Valued Forum Contributor
    Join Date
    12-02-2012
    Location
    Melbourne, VIC
    MS-Off Ver
    Excel 2016
    Posts
    750

    Post Shell function gives File not Found error

    Operating System : Windows 7, 64-bit
    Excel Version : 2010, 32-bit
    Problem:
    When the following code executes, I get the MsgBox output and the immediate window (Debug.Print Err) shows 53 (which I believe is the "File not Found" error). However, the file is most definitely there as I have run it through the Start Menu\Run as well as through Windows Explorer. How do I run/launch the SnippingTool from within Excel? Please help.

    VBA Code (as follows)
    Option Explicit
    Sub Run_SnippingTool()
    Dim taskID As Variant
    
    On Error Resume Next
    taskID = Shell("C:\windows\system32\SnippingTool.exe", 1)
    
    Debug.Print Err
    If Err <> 0 Then MsgBox "Snipping Tool is not installed on this system."
    
    End Sub
    Additional Information :
    This Macro is a part of a custom tab on the Ribbon where I would like to provide a few tools such as "Calculator", "Notepad", "Snipping Tool". These would come really handy when a user is working with this specific workbook. The same code for Calculator and Notepad works fine, but for the Snipping Tool it doesn't. However, as I would be sharing this workbook with different users, the solution needs to be such that all the necessary code/objects should be on this one single workbook.

    Warm regards,
    Jewel
    Last edited by jewelsharma; 03-04-2014 at 05:17 AM. Reason: To better explain the problem (or at least try to :))

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. shell to open external bat file
    By zhuleijia in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-07-2013, 12:28 AM
  2. [SOLVED] Message (in one window) for each file found/not found
    By kboy1289 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 02-08-2013, 04:03 PM
  3. Problem using shell to call batch file or cmd prompt
    By nickf829 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2011, 10:27 PM
  4. Open File problem using Shell command
    By roelvdh in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-13-2010, 03:41 PM
  5. [SOLVED] Using Shell To Get File Info
    By MDW in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-07-2006, 07:30 AM

Tags for this Thread

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