Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

References

Status
Not open for further replies.

KreativeKai

Programmer
Nov 12, 2004
33
0
0
US
I have a windows form application written in VB.NET 2005 which opens Excel, imports a text file into a worksheet and e-mails it to the end-user.

Everything works fine when it is on my own system, but when I put the executable file on the server along with all the other files in the bin\release folder, I get the following error:

HPtoExcel has encountered a problem and needs to close. We are sorry for the inconvenience.

I had the following references in my program and it ran fine on my system:
Microsoft Excel 11.0 Object Library
Microsoft Office 11.0 Object Library
Microsoft Visual Basic for Applications Extensibility

I added the following references and still receive the error:
Microsoft.Office.Tools.Common
Microsoft.Office.Tools.Excel
Microsoft.VisualStudio.Tools.Applications.Runtime
OLE Automation

The server does not have Excel on it, but my system does. I'm double clicking on a shortcut on my desktop to the exe on the server. Is there a way to get around loading Excel on the server?

Any help is appreciated.

Lost in the vast sea of References

Lost in the Vast Sea of .NET
 
If you want to make use of Excel in your code, you're dependent on Excel being loaded on whatever machine you deploy your app on.

Note that Microsoft does not recommend installing Excel on a server, as it is written with a single-user in mind, and having multiple users running it is likely a license violation, as well as likely to have it act strange.

But, should you really want to do this, do a search here and in the VB6 forum for important information regarding cleanup of Excel's COM resources.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Perhaps you should check Microsoft site. They released some redistributable office interops.
But, beware of the warning in the readme file.

Regards,
mansii
 
I called Microsoft using one of our MSDN incidents. Basically Office is designed for interactive usage and they do not recommend automating it with an unattended application. They also do not support Office being installed on a server because it is not designed to work on a server.

Here is a link showing their “Not supported” statement and their “at your own risk” workarounds:

I used the workaround towards the end of the article related to “How to configure Office applications to run under the interactive user account” and I put the application on a client PC using scheduled tasks instead of on a server.

Thanks for all your input everyone!!


Lost in the Vast Sea of .NET
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top