+ Reply to Thread
Results 1 to 4 of 4

If file does not exist, msgbox

  1. #1
    Registered User
    Join Date
    11-12-2015
    Location
    Cheshire, England
    MS-Off Ver
    2007
    Posts
    10

    If file does not exist, msgbox

    Hi there,

    I am looking to build some coding to create a msgbox when a file cannot be found. The actual coding to open the file is as per the below:

    Workbooks.OpenText Filename:=Range("I12").Value & "\ACCR_AMEX_VISA_Rates_and_FCR.csv"

    If the above cannot be found, a simple msgbox with "file cannot be found" will suffice.

    Can anyone help please?

    Thank you.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: If file does not exist, msgbox

    Perhaps.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: If file does not exist, msgbox

    Hi and welcome to the forum.

    Try something like this...
    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    11-12-2015
    Location
    Cheshire, England
    MS-Off Ver
    2007
    Posts
    10

    Re: If file does not exist, msgbox

    Thanks guys, appreciate the prompt response. Both worked perfectly!

+ 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] Sheets does exist but printed on Msgbox
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-02-2015, 11:47 PM
  2. [SOLVED] how to run macro or msgbox when Worksheet does not exist/exist
    By herukuncahyono in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-14-2013, 10:54 PM
  3. Check range if multiple names exist then show msgbox
    By c.pedersen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-15-2012, 06:23 AM
  4. Have macro over write existing file from control button if file exist
    By pjbassdc in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-30-2011, 10:35 AM
  5. Show MsgBox if mentioned Sheet does not exist
    By ebin charles in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-20-2011, 04:30 PM
  6. Replies: 3
    Last Post: 03-11-2006, 02:50 PM
  7. Replies: 0
    Last Post: 03-10-2006, 05:55 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