[Last Call] Learn how to a build a cloud-first strategyRegister Now


Generate dropdownlist in Excel file using ASP

Posted on 2007-07-26
Medium Priority
Last Modified: 2007-12-19
Hi all

I have an ASP page to generate an Excel file
here's how i generate it :

Response.ContentType ="Application/vnd.excel"
Response.AddHeader "Content-Disposition", "attachment; filename=Filename.xls"

And i have another page to upload the modified excel page and add it to the database

What i want to do, is that when i Generate  the Xls file, is that i populate some columns with dropdown list to  be sure that the client won't put anything else in these columns

example, i have 25 records in my generated excel file
and the column i want to validate is B
so, from B1 to B25, there must be a dropdown list with the database value selected

Thx a lot for your help guys

Question by:jalalmegadeth
  • 3
  • 3
LVL 16

Accepted Solution

golfDoctor earned 1800 total points
ID: 19581867
You cannot do this with ASP.  All you do by setting the header is push the file out as excel doc.  

You cannot control excel from ASP without creating an instance of Excel application with ASP.  And, for that you need Excel (or libraries) installed on the server.   Then you would build Excel file just like you would in Excel, not by setting header.

So it's totally different than what you are doing.

Assisted Solution

saoirse1916 earned 200 total points
ID: 19582096
Here's a good article on using OWC to use some of the more advanced features of Excel.


Author Comment

ID: 19582495
@golfDoctor: thx for your answer
Do you have any links please so I can read more about that. I would apreciate it if you have a link that explains how to manipulate an XLS file using libraries (specially what i need is just how to create dropdown lists)

Technology Partners: 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 16

Expert Comment

ID: 19582666
"specially what i need is just how to create dropdown lists"

You cannot pick and choose.  you would need to create entire file with instance of Excel application.  So, you wouldn't be able to use the header like you do now, you would need to create the file with Excel instance.

Here are examples of using Excel instance:

Author Comment

ID: 19583837
thx a lot

In fact i didn't explain well, what i meant to say by : "specially what i need is just how to create dropdown lists" is that i'm going to change the way that i generate the XLS file

I have read your links and it sounds good, this way gives me much control on the XLS file, so yeah sure i'm gonna use it like this

All i need now is a vbscript (for asp, not asp.net) to create dropdown lists in some columns

thx a lot
LVL 16

Expert Comment

ID: 19584383
VBA for Excel and VBScript are very similar.  See this for VBA example:


The VBScript would be virtually the same, except you don't declare variable type in DIM.

I don't have an exact example, so hope this helps.

Author Comment

ID: 19589063
yup, that helps, it gave me a nice start point

thx a lot golfdoctor

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

834 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