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

ID: Q247318


The information in this article applies to:
  • Microsoft Excel 2000
  • Microsoft Word 2000
  • Active Server Pages


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 = "/test/test.xls"
 Response.Write("<META HTTP-EQUIV=Refresh CONTENT=""0;URL=" + strRedirect + """>")
%>
</HEAD>
</HTML> 


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products 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:


  3. 
    <%@ Language=VBScript %>
    <% 
     ' Set the page to redirect the user to
     strRedirect = "/RedirectTest/test.xls"
     Response.Redirect strRedirect
    %>
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    This is the BODY tag of the ASP page
    </BODY>
    </HTML> 
  4. Save the file as Redirect.asp in the RedirectTest virtual directory.


  5. Create an Excel file called Test.xls and place it in the RedirectTest virtual directory.


  6. 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."


© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Mark Durrett, Microsoft Corporation


REFERENCES

For additional information, please click the article number below to view the article in the Microsoft Knowledge Base:

Q225234 OFF2000: Link to Office Document Produces Password Prompt

Additional query words:

Keywords : kbASP kbASPObj kbExcel kbWord kbGrpDSO kbDSupport
Version : WINDOWS:2000; winnt:
Platform : WINDOWS winnt
Issue type : kbbug


Last Reviewed: December 4, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.