INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Creating Excel files in Classic ASP on an intranet

Creating Excel files in Classic ASP on an intranet

(OP)
This used to work for be several years ago before I updated Office to 2010. Now some old web code I used to use a lot no longer works. I am creating excel files in vbscript. So here's what's happened:

1. I get a "permission denied" error when this line is executed: Set xlsObject = CreateObject("Excel.Application")
2. So I setup the security settings for Excel using DCOMCNFG and added <pc-name>\IIS_IUSRS giving it full control
3. I then went into the folder where Excel.exe is found (C:\Program Files (x86)\Microsoft Office\Office14) and added the same user to its security settings.
4. I haven't gotten to the point where the file is going to be saved, but I also added that user to the security settings of the folder where the Excel files will be written.

I don't know what else to do. I'm sure someone out there has had to do this before and has a suggestion. Whatever is the final things to do I'm going to write them down in case I need to do it again.

I'm running my site under IIS 6.1 on my desktop computer. This code works on my customer's intranet, but he is using very ole technology that will be going away shortly, but I need to be able to tun this here so I can show him the Before and After that I propose to create printed output differently.

Thanks in advance,
Jerry

Jerry Scannell

RE: Creating Excel files in Classic ASP on an intranet



To use Excel for 'anonymous' access via a HTTP request the "Everyone" User Group needs to have 'full control' permissions to Excel.exe on the server.

Also you should be using Server.CreateObject(... ) for the DCOM object to run in the server context rather than the logged in user context.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: Creating Excel files in Classic ASP on an intranet

(OP)
Chris,

Thanks for the response. It's the "Everyone" user that needs the access and not the IIS_IUSRS one? I didn't realize that.

I will check that out.

Do I only need to use dcomcnfg? Or do I also need to add the security to the destination folder?

Jerry

Jerry Scannell

RE: Creating Excel files in Classic ASP on an intranet

Quote:

It's the "Everyone" user that needs the access and not the IIS_IUSRS one? I didn't realize that.

Okay, to explain the why, it is because HTTP access is 'anonymous' meaning that no user needs to be directly logged to the server. This does not mean that the IIS_USR account is 'logged in' and can access arbitrary file locations, it isn't.
The IIS_IUSRS account is only for running the HTTP Server instance and for accessing files within the site document root location, it does not act as an 'interactive' user account.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.

Never mind this jesus character, stars had to die for me to live.

RE: Creating Excel files in Classic ASP on an intranet

I struggled for years to get office automation to work properly in an IIS/ASP environment and all my research said basically don't try it as it is not reliable/scalable. So hats off to you that you got it to work at all!

Just my tuppence worth - two possible alternatives:

1. Generate the document as HTML and put in an Excel header - you will get a warning saying it's not a "real" Excel file but if you can live with that then it's quite a simple solution.

2. a) on your web page have a button that says Export to SQL. If you click this button it saves the SQL query in a table next to your windows username.
b) write a little desktop HTA app that looks for queries with your name and then uses client side vbscript to execute query and save to Excel.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close