When you try to save a Microsoft Office Excel 2003 workbook that was opened from a mapped drive location (such as Z:\folder), you may receive one of the following error messages:
'path\filename.xls' cannot be accessed. The file may be read-only, or you may be trying to access a read-only location. Or, the server the document is stored on may not be responding.
Runtime error 1004: Cannot access path\filename
This problem may occur if either of the following conditions is true:
On the File menu, you click Save As, and then you type a UNC path (such as \\server\share) in the File name box to resave the file back to its original file name and location.
You programmatically save the file back to its original file name and location by using a UNC path (such as \\server\share).
This problem is resolved in Microsoft Office 2003 Service Pack 1. To fix this problem, install the latest service pack. If you cannot install the latest service pack for Microsoft Office 2003 for some reason, you can obtain a hotfix that will also fix this problem. However, after you install the hotfix, you have to enable the hotfix. To do this, go to the "More information" section. If you want to work around this problem instead of resolving it, go to the "Workaround" section.
How to obtain the latest service pack
To resolve this problem, obtain the latest service pack for Microsoft Office 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
870924 How to obtain the latest service pack for Office 2003
You are now finished with this article. The rest of this article is only for customers who decide to install the hotfix or to try the workaround.
How to obtain the hotfix
This issue is fixed in the Excel 2003 hotfix package February 29, 2004. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
833855 Excel 2003 hotfix package: February 29, 2004
After you install this hotfix, follow the steps that are listed in the "More Information" section of this article to set the SupportUNCMappedDriveSaveAs registry key and to activate the hotfix.
Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:
322756 How to back up and restore the registry in Windows
To enable this hotfix, follow these steps:
Quit Excel 2003.
Click Start, click Run, type regedit, and then click OK.
Locate and then click to select the following registry key:
Check whether the problem is fixed. If the problem is fixed, you are finished with this article. If the problem is not fixed, you can contact support.
To work around this problem, do one of the following:
On the File menu, click Save.
Note Do not click Save As on the File menu to resave the file back to its original file name and location by using a UNC location.
Use the following code in your program.
Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
Sub test() ActiveWorkbook.SaveAs ActiveWorkbook.Path & "\filename.xls"End Sub
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Office 2003 Service Pack 1.