+ Reply to Thread
Results 1 to 4 of 4

Message Prompt if Path is invalid

  1. #1
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Message Prompt if Path is invalid

    Hi, i have a getsheet marco where user would type in the path in cell A1 and extract all the xls file.
    Below is a extract of my code.
    How can i make it that if Path is invalid, there will be a error message "Invalid Path"?

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: Message Prompt if Path is invalid

    You can use this function (put in the bottom of the module outside the sub)
    Please Login or Register  to view this content.
    And in your main code:

    Please Login or Register  to view this content.
    Tuomas "Banaanas" Savonius
    Trying to give back now when I actually can do some VBA

  3. #3
    Forum Contributor
    Join Date
    03-12-2012
    Location
    Singapore
    MS-Off Ver
    MS 365
    Posts
    532

    Re: Message Prompt if Path is invalid

    Just curious, can we use On Error go to?

  4. #4
    Forum Contributor banaanas's Avatar
    Join Date
    08-26-2014
    Location
    Finland
    MS-Off Ver
    2016
    Posts
    199

    Re: Message Prompt if Path is invalid

    Of course, you can, but I dislike it. If you run later in the code into problems, then it will show the error go to message, even if it isn't related to it.
    Is there a reason why you wan't to use it?

    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] Invalid path Error when I try to access ADO Recordset
    By swallis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-03-2018, 06:21 AM
  2. MS Access ADODB Connection String - Invalid File Path, Does not Exist
    By ironfelix717 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-17-2018, 08:01 AM
  3. IF(AND ....) get invalid message
    By Nomad1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-16-2016, 01:46 PM
  4. Path name invalid when trying to save a workbook - VBA
    By Jamiec94 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-17-2013, 12:42 PM
  5. Message for invalid entry
    By LilyLove in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 04-26-2013, 08:42 AM
  6. [SOLVED] VBA - User prompt to determine path to files
    By michaelisk in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-08-2013, 05:03 PM
  7. Prompt to select file/path and store as variable
    By GeorgY in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-30-2009, 03:44 AM

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