[SOLVED] Microsoft.Office.Interop.Excel.Application

Answered
0
0

Hi,

I ave an application that work whit Microsoft.Office.Interop.excel to generate report from excel template.

In my developer PC the follow instruction work fine:

Dim XlApp As New Microsoft.Office.Interop.Excel.Application
Dim XlBook As Microsoft.Office.Interop.Excel.Workbook = Nothing
Dim XlSheet As Microsoft.Office.Interop.Excel.Worksheet = Nothing

But when load application on server i get the error attached.
My developer PC and the sever have office 2013 installed.

My question is:
It’s possible to use Microsoft.Office.Interop in Wisej?

Thanks in advance

Attachment
  • You must to post comments
Best Answer
1
0

We use ClosedXML, it also supports Excel Report Templates – its probably more stable on servers and most likely faster.

It’s in a few of our WiseJ applications and we have seen no issues at all.

https://github.com/ClosedXML/ClosedXML

What can you do with this?

ClosedXML allows you to create Excel files without the Excel application. The typical example is creating Excel reports on a web server.

Check out the Extension for Excel reports:

https://github.com/ClosedXML/ClosedXML.Report

ClosedXML.Report is a tool for report generation and data analysis in .NET applications through the use of Microsoft Excel. It is a .NET-library for report generation Microsoft Excel without requiring Excel to be installed on the machine that’s running the code. With ClosedXML.Report, you can easily export any data from your .NET classes to Excel using the XLSX-template.

  • You must to post comments
0
0

Hi Angelo,

looks like a security issue.

You might want to check out this discussion at StackOverflow:

https://stackoverflow.com/questions/1491123/system-unauthorizedaccessexception-retrieving-the-com-class-factory-for-word-in/3491486#3491486

Best regards
Frank

  • You must to post comments
0
0

Hi Angelo,

the interop is just like a kind of interface. To make it working on your server, you must install office.

But I think there could be a licence issue, when you install and use office on a webserver.

To answer you question: Yes it is possible with Wisej (see your local machine tests), but not recommended on a WebServer, because of possible licence issues.

Best,

Jens

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.