Solved

An Error occurs when trying to open an Excel file from web page

Posted on 2011-03-14
7
769 Views
Last Modified: 2012-05-11
I'm having difficulty opening a Microsoft Excel 2003 (XLS) file when using IE 8.  Here are the errors I get:

Microsoft Excelcannot access the file 'https://site/file/contacts.xls'. There are several possible reasons:

The file name or path does not exist.
The file being used by another program.
The workbook you are trying to save has the same name as a currently open workbook.

The site is an ASP.Net 2.0 site, using IIS 6.0. I have Office 2007 installed on my PC, which is using Windows 7.0. I am using the <a href a> tag to open the file. The file does exist. Are there security settings that I need to take to allow this file to open?

Thanks,
0
Comment
Question by:gtrapp
  • 4
  • 2
7 Comments
 
LVL 2

Expert Comment

by:RouterRat
ID: 35137665
I believe if conditions would be like this;

The file being used by another program.
The workbook you are trying to save has the same name as a currently open workbook.

You would be still able to open it but it would say read-only.

As you are having an access error, you should make sure you have the rights for it, for example if it is a sharepoint site or a site that you login w/username and password.

Make sure your Windows Firewall/ 3rd party firewall/web shield/http shield etc. allows it. or test it without these things are running.

Test the same thing on a mac to see what's happening (this helps alot if you are testing functuonality of websites)

Of course do all these after you make sure you know how the file server works, and you have rights for it and now you know that it is a problem with the local machine you are using.
0
 

Author Comment

by:gtrapp
ID: 35140967
The document does not open at all. This is a new file, and not a SharePoint file. On the site, I can download PDF files with no problems.  I don't have a Mac.

Would the problem be related to the site using HTTPS?
0
 

Author Comment

by:gtrapp
ID: 35141414
What about using a different format for the XLS file? Open Office Document, XML or Text?  
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 16

Expert Comment

by:sjklein42
ID: 35141767
When you right-click on the link to the xls, and Save it as a file, can you then open the file locally?
0
 

Author Comment

by:gtrapp
ID: 35142256
I can not open the XLS locally. I have tested CSV, XLSX, and XLS and this failed to open. When I select "Save as Target..." I see:

"Unable to download contacts.xls from www.site.com. The file could not be written to the cache."

When I click on the link for XML, this file opens up and I can save it locally.

Oddly, once the XLS, XLSX and CSV files where download successfully. Then, subsequent times, they failed.
0
 
LVL 16

Accepted Solution

by:
sjklein42 earned 500 total points
ID: 35142437
It does sound like it is a security setting on the web server that is preventing you from either saving or opening the file.  Opening it in EXCEL requires first saving it in the local cache.

It could be the https vs http, but there are also server settings that control whether the Cache-Control: no-cache, and Pragma: no-cache HTTP header directives are sent along with the file.  These directives will prevent the browser from saving the download to disk.

These HTTP(S) header settings need to be changed on the web server.  They are not under control of the browser.
0
 

Author Comment

by:gtrapp
ID: 35142836
I looked under the HTTP Headers and see what you are talking about. Cache-Control: no-cache, and Pragma: no-cache are in the custom HTTP headers. I removed these and the XLS file was able to downloaded,.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Access 2016 - Use a Button to Select a specific Record on a form 12 72
Display multiple images in report 12 116
Problem to open text file 11 106
Sporadic connectivity issues 6 38
We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Viewers will learn the different options available in the Backstage view in Excel 2013.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now