+ Reply to Thread
Results 1 to 3 of 3

On Error open wb

  1. #1
    Forum Contributor
    Join Date
    01-28-2013
    Location
    sweden
    MS-Off Ver
    Excel 2010
    Posts
    108

    On Error open wb

    Hi,

    I have a macro where I import data to one wb from a CSV file.

    Code look like this:

    Please Login or Register  to view this content.
    I want to execute a vbCritical msgbox saying file not found if line "Open "Myfile.CSV" For Input As #1" generates an error.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: On Error open wb

    Hi,

    You might test with Dir for the existence of the file
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Forum Contributor
    Join Date
    01-28-2013
    Location
    sweden
    MS-Off Ver
    Excel 2010
    Posts
    108

    Re: On Error open wb

    Works just perfect. Thanks!

+ 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] Excel Hyperlink to open pdf- Error - "No program is registered to open this file
    By laxminarayana in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-27-2016, 10:03 AM
  2. Run-time error '55' open txt
    By slxia1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-15-2014, 10:58 PM
  3. Replies: 0
    Last Post: 10-20-2014, 05:33 PM
  4. workbooks.open error
    By vban00b8 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-26-2012, 03:49 PM
  5. Error using Workbooks.open
    By Yona in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-24-2012, 01:03 PM
  6. Can't get into Excel. An error won't let it open. Help
    By uc organics in forum Excel General
    Replies: 0
    Last Post: 06-25-2006, 09:15 PM
  7. Error, Worksheet Will Not Open
    By Wandering Mage in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2005, 11:05 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