+ Reply to Thread
Results 1 to 1 of 1

How to close a csv file?

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    06-19-2010
    Location
    Holywell, N Wales, UK
    MS-Off Ver
    Excel 2013
    Posts
    470

    How to close a csv file?

    Hi All

    I have been experimenting with exporting data to a csv file.

    My procedure failed in the middle of an "export".

    I now can't export anything because of a "File Already Open " error.

    Can anyone tell me how to close an open file please?

    I have tried using a differnt file name and closing closing down Excel but still get the same error message.

    Also tried running the Close bit of the code below to no avail


    iFNum = FreeFile
    Open sFname For Output Access Write As #iFNum
       my data export code here
       e.g. Print #iFNum, HeadLine
              etc. etc.
       code failure in here somewhere?
    Close #iFNum
    Any help much appreciated
    TIA
    barry

    OOPS!
    Red face time - sorry guys!
    My export code utilises a loop and my Open statement was inside the loop.
    With apologies
    barry
    Last edited by barryleajo; 09-12-2010 at 01:56 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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