Solved

When calling Excel the assigned file name is substituted with part of the URL

Posted on 2004-10-01
6
249 Views
Last Modified: 2008-02-20
Hi!

I have the following VBScript code:

For some reason when the page is called instead of passing the below listed filename it shows part of the page's URL which will not work with Excel.

Any ideas?

     ' set the filename to statement.xls
      Response.AddHeader "Content-Disposition", "filename=statement.xls"
     ' set the mime type to Microsoft Excel
      Response.ContentType = "application/vnd.ms-excel"
0
Comment
Question by:TrueBlue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 15

Expert Comment

by:Thogek
ID: 12205906
Try
    Response.AddHeader "Content-Disposition", "attachment; filename=statement.xls"
0
 

Author Comment

by:TrueBlue
ID: 12205956
Hi Thogek!

I tried your suggestion, but I am still getting the same problem.

Any other ideas?
0
 
LVL 15

Expert Comment

by:Thogek
ID: 12206040
What do you mean by "it shows part of the page's URL"?  Where?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Accepted Solution

by:
Thogek earned 250 total points
ID: 12206043
And make sure that these statements are being called before any Response.Write calls.
0
 

Author Comment

by:TrueBlue
ID: 12206046
Hi Thogek!

When the window pops up. It says "Do you want to open or save this file?"
Name: ExcelAROpenTrans_ASP?ID=1234
Type: Microsoft Excel Worksheet, 2.57KB
From: secured.domain.com
0
 

Author Comment

by:TrueBlue
ID: 12206072
Hi Thogek!

I figured it out. There was a type mismatch that was causing the wrong filename to be displayed.

I commented out the lines so that the data would be displayed on the screen as opposed to being sent to Excel and discovered the mismatch error.

Thank you.
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

728 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