• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

ASP.net VS Excel

Hello Experts,

I wrote an ASP.net site which could import data to an excel file.
This works fine untill I post the site onto my (ASP.net)server where I become the following error each time I try to start the site by \\localhost.
----------------------------------------------------------------------------------------------------
Errormessage from  compiler: BC30002: The type Excel.Application can't be defined

Error in Source:

Regel 13:     Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Regel 14:        
Regel 15:         Dim EXL As Excel.Application      ---------> Is highlighted!!!!!!
Regel 16:         Dim WBK As Excel.Workbook
Regel 17:         Dim SHEET As Excel.Worksheet
 
Somebody an Idea????

 
0
Masterofdisaster1020
Asked:
Masterofdisaster1020
  • 5
  • 4
2 Solutions
 
Éric MoreauSenior .Net ConsultantCommented:
Hi Masterofdisaster1020,

Is Excel installed on your web server? It has to be installed in order to be instantiated.

Cheers!
0
 
Masterofdisaster1020Author Commented:
Hi emoreau

It is installed and I also loaded the refference....,

regards
masterofdisaster
0
 
Éric MoreauSenior .Net ConsultantCommented:
It may be a permission problem. Is the user under which IIS runs has access to Excel?
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

 
Masterofdisaster1020Author Commented:
everybody, including the IIS WPG has full control on the Excel Application.
0
 
Éric MoreauSenior .Net ConsultantCommented:
Masterofdisaster1020,

Open the References of your project, click on Excel and Office core and set their "Copy Local"^property to True. This will adds new DLLs in your bin folder. Be sure to copy these dlls to the server.
0
 
Masterofdisaster1020Author Commented:

Cause I did not found the property, I just deleted the complete Bin dirctory and re-imported the refferences of microsoft excel 11.0 lib, but it isn't a solution.
 
0
 
Éric MoreauSenior .Net ConsultantCommented:
Masterofdisaster1020,

From the solution explorer, open the "References". Click on Excel. Then in the Properties dialog, you will see the "Copy Local" property.
0
 
Masterofdisaster1020Author Commented:
emoreau

I'm working with visual web developer 2005 express edition. Could it be possible there is no possibility to change property's of the references? There is also no reference tab in my sol. expl., like it is in visual studio 2003.

When I import a reference into the project, I only become the BIN directory with the appropriate .DLL s.
 
0
 
Éric MoreauSenior .Net ConsultantCommented:
In a 2005 Windows Forms application, to find the references, I have to open the properties of the project (Properties from the Project menu). in the tabs on the left, you will find "References". Click on it. Select Excel from the list and in the properties dialog you will find "Copy Local"
0
 
gr33nlant3rnCommented:
You might want to consider not using excel directly on the web server.  Here is a link to a free dll that you might find to be a better solution.

http://www.carlosag.net/Tools/ExcelXmlWriter/Default.aspx

Some people will argue that automating excel on the web server does not scale well and is bad practice.  For that reason, it is a good idea to utilize libraries such as the above.  He has good example code on his site to get you going as well.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now