Run-time error '1004': Microsoft Excel cannot access the file


  • Using VBA script within Excel for MS Office Professional Plus 2010.

    Attempting to access a CSV (comma delimited file) within a document library in a SharePoint Site (SharePoint 2007), using VBA script.

    The VBA script successfully opens the CSV file when running under Excel for MS Office 2003.  I am in the process of migrating to Office 2010 and trying to evaluate & update VBA scripts written for Office 2003.

    VBA line of code that is intended to open the CSV file is: Filename:="" & "RawData.csv", Format:=2

    Symptom of Issue:

    I'm getting the Run-time error '1004': Microsoft Excel cannot access the file ''. There are several possible reasons:

    • The file name or path does not exist
    • The file is being used by another program.

    I have spend considerable time reviewing web sites looking for a solution.  I have not found a solution, yet. 

    Can anyone help me with this issue?  Any ideas that I should try?  I appreciate any help.

    Friday, June 25, 2010 5:29 PM

All replies

  • On the PC you tried this on, in Excel 2010, can you File > Open this file successfully?


    Bill Manville. Excel MVP, Oxford, England.
    Friday, June 25, 2010 11:20 PM

    Regarding File > Open:

    I can open this file if it exists on a local or network drive, but not if its in a SharePoint document library.  Office 2010 recogizes that this file exists in the SharePoint document library, but cannot open it.

    Saturday, June 26, 2010 12:45 AM
  • My experience of Sharepoint is limited.

    If you can't open the file via file open, or presumably by putting the URL in a cell as a Hyperlink and following the link, there may be some problem in accessing the sharepoint site from this machine??

    Rather than using the above URL to open the file, can you do File > Open > My Network Places >... and get to the file on Sharepoint that way? 

    Bill Manville. Excel MVP, Oxford, England.
    Saturday, June 26, 2010 3:51 PM
  • In Office 2010

    I unsuccessfully tried opening the file:

    • Through Excel 2010 menu: File > Open > select file in the file dialog (Bill Manville's suggestion). 
    • Double clicking on the file from the SharePoint site  (using Windows IE 8).
    • Opening the SharePoint Document Library using Windows Explorer and double clicking on file from Windows Explorer.

    However, if I download the file to the local or network drive, I can open the document with either the Windows Explorer or the File > Open method.

    From this experience, appears that the interaction of Office 2010 with SharePoint is an issue.  Any possible solutions to this issue?

    In Office 2003

    I successfully tried opening the file using all of the above methods.  I tried Office 2003 in both a:

    • PC with Win XP OS and
    • PC with Win 7 (using Win XP Virtual PC Applications). 
    Monday, June 28, 2010 11:07 AM
  • Hello,

    For this error, here is a KB article introducing how to fix it in Office 2007 and SharePoint 2007. Although the versions of Office are different, it might give you some useful information. Here is the link:

    Also here is a thread in TechNet which might interest you:

    Hope this helps you,

    Best regards,

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, July 01, 2010 2:22 PM
  • Thanks, Bessie, for your reply.

    I tried "Hotfix for Office (KB949405)".  After unzipping and executing the office-kb949405-fullfile-x86-glb application and accepting terms for use, the message I receive is "There are no products affected by this package installed on this system."

    I reviewed the TechNet thread you referenced in your note.  The thread refers also to KP840386, which applies to users of IE6.  I am using IE8.

    Do you have any other ideas to try?  I appreciate your help with this issue.

    To recap, I'm using Office 2010, Win 7, and IE8.

    Tuesday, July 13, 2010 3:57 PM
  • Same issue with one of my users. Can't open Excel file located on Sharepoint 2003. She using Office 2010, so I guess KB949405 will not solve the problem.

    Any ideas will be appreciated.

    Wednesday, July 14, 2010 4:45 PM
  • Is this issue resolved. We are also facing the same issue in one of our machine.
    Wednesday, September 29, 2010 4:24 AM
  • There are few ideas found in this thread.

    Tuesday, October 05, 2010 6:31 AM