Solved

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

Posted on 2004-10-01
6
245 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
  • 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

770 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