+ Reply to Thread
Results 1 to 4 of 4

CSV Import Prompt into a Sheet - How to resolve crash if no file is selected

  1. #1
    Registered User
    Join Date
    05-16-2019
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    54

    CSV Import Prompt into a Sheet - How to resolve crash if no file is selected

    As subject says really, here is the VBA code for the macro:

    Please Login or Register  to view this content.

    I did try to add:
    Please Login or Register  to view this content.
    ...and whilst this stopped the crash if I didn't select the file, it also stopped me from Importing the file in the first place.

    Appreciate any help

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: CSV Import Prompt into a Sheet - How to resolve crash if no file is selected

    Did you try
    Please Login or Register  to view this content.
    - Battle without fear gives no glory - Just try

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow Re: CSV Import Prompt into a Sheet - How to resolve crash if no file is selected


    Jut an obvious bad FileName variable data type as according to GetOpenFilename VBA help - a must read ‼ - it must be Variant …

  4. #4
    Registered User
    Join Date
    05-16-2019
    Location
    London, England
    MS-Off Ver
    2016
    Posts
    54

    Re: CSV Import Prompt into a Sheet - How to resolve crash if no file is selected

    Thank you PCI! Works 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. Import Sheet1 from file selected via a dialog box
    By chrisellis250 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-20-2022, 07:37 AM
  2. [SOLVED] Macro to prompt user to select a file and the selected file should saved in location
    By logesh excel in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-26-2015, 03:43 PM
  3. [SOLVED] MACRO: Store name of selected file as string w/ import data file dialog box
    By AnnieMcken in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-13-2013, 02:13 PM
  4. File name without file path (data import) - Excel crash
    By exinx in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2012, 02:08 AM
  5. File import - select file and import sheet(1) from closed workbook
    By Armitage2k in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-22-2011, 03:15 AM
  6. Prompt user to select file to import
    By Lmsloman in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-19-2009, 07:23 PM
  7. Import selected file to specific sheet
    By jnate in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-02-2009, 09:41 PM

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