+ Reply to Thread
Results 1 to 2 of 2

Error when searching for files

  1. #1
    Forum Contributor
    Join Date
    06-27-2014
    Location
    bristol, england
    MS-Off Ver
    excel 2007
    Posts
    264

    Error when searching for files

    Hi guys i am using the below bit of code, to search for files this works fine if i locate the file and press ok, this inserts the file path into textbox7 as it should, the problem i have if i press the cancel button when searching files, "FALSE" is entered in textbox7, how can i stop this happening so textbox7 is left blank

    Thanks

    Scouse13

    [code]
    Private Sub CommandButton6_Click()

    Dim x As String
    x = Application.GetOpenFilename
    TextBox7 = x

    End Sub
    [code/]

  2. #2
    Registered User
    Join Date
    07-02-2013
    Location
    Cheshire
    MS-Off Ver
    Office Professional 2007
    Posts
    79

    Re: Error when searching for files

    Hi there. The getopenfilename will return False if nothing was selected (i.e. cancel was pressed). So,
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] searching for files if they exists
    By charliec in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2019, 03:32 PM
  2. Searching for files in various folders help
    By epactheactor in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-11-2018, 11:08 AM
  3. [SOLVED] Currently searching only 1 value. Is it possible to set a StrSearch as many files?
    By graym463 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-27-2015, 06:26 PM
  4. How to copy and rename files in vba by searching multiple folders for files
    By razorace in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2014, 04:21 AM
  5. Searching Multiple csv files
    By Luke101 in forum Excel General
    Replies: 1
    Last Post: 11-16-2011, 02:08 AM
  6. Searching HTML Files?
    By yl358 in forum Excel General
    Replies: 1
    Last Post: 06-26-2006, 06:08 PM
  7. Searching for files that contain ???
    By Ken Loomis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-04-2005, 01:05 PM

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