Microsoft Knowledge Base Email Alertz

(247318) - When using Response.Redirect in an Active Server Page (ASP) to redirect the client to a Microsoft Word document or a Microsoft Excel spreadsheet, the corresponding Microsoft Office application does not display the correct file that it was redirected...

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

BUG: Word 2000 and Excel 2000 Do Not Redirect Correctly When Using Response.Redirect

Article ID: 247318 - View products that this article applies to.
This article was previously published under Q247318

On This Page

SYMPTOMS

When using Response.Redirect in an Active Server Page (ASP) to redirect the client to a Microsoft Word document or a Microsoft Excel spreadsheet, the corresponding Microsoft Office application does not display the correct file that it was redirected to.

CAUSE

Microsoft Office 97 applications open files on a Web server as read-only. Microsoft Office 2000 applications try to open files that are located on a Web server read-write. If the user that is logged into the client's machine is an administrator on the Web server, the Office applications try to open the file read-write and parse and display the static HTML in the .ASP file to the client. If the user is not in the administrators group on the Web server, the user is prompted for authentication and the client is redirected to the file as expected.

RESOLUTION

As a workaround, you can use META tags to redirect the client to the Office file. For example:
<%@ Language=VBScript %>
<HTML>
<HEAD>
<% 
 ' Set the page to redirect the user to
 strRedirect = "http://support.microsoft.com/test/test.xls"
 Response.Write("<META HTTP-EQUIV=Refresh CONTENT=""0;URL=" + strRedirect + """>")
%>
</HEAD>
</HTML>
				

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new virtual directory on your Web server named RedirectTest.
  2. Start Notepad to create a new Active Server Page. Place the following code in Notepad:
    <%@ Language=VBScript %>
    <% 
     ' Set the page to redirect the user to
     strRedirect = "http://support.microsoft.com/RedirectTest/test.xls"
     Response.Redirect strRedirect
    %>
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    This is the BODY tag of the ASP page
    </BODY>
    </HTML>
    					
  3. Save the file as Redirect.asp in the RedirectTest virtual directory.
  4. Create an Excel file called Test.xls and place it in the RedirectTest virtual directory.
  5. When you navigate to http://<servername>/RedirectTest/Redirect.asp, note that Excel 2000 starts and displays the text "This is the BODY tag of the ASP page."

REFERENCES

For additional information, click the article number below to view the article in the Microsoft Knowledge Base:
225234 OFF2000: Link to Office Document Produces Password Prompt
266263 BUG: Word 2000 and Excel 2000 Display ASP Source When Using MIME Type To Stream Data

Properties

Article ID: 247318 - Last Review: December 15, 2003 - Revision: 4.1
APPLIES TO
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Word 2000
  • Microsoft Active Server Pages 4.0
Keywords: 
kbaspobj kbbug kbfaq kbpending KB247318
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate