Control Excel from a service

Hello,

I create a web server with Xojo for several reports. The server needs to export files into Excel-Format (also with charts). I tried to use the excel class for transfer the data to excel and downloading the file. This works fine as long as the server runs as an application.

BTW the server is a Microsoft IIS server

But for the final version, it must run as a service. But as service it is not possible to start Excel and remote control it. Did someone had the same problem - and solved it.

I have used this plugin: https://einhugur.com/Html/ExcelWriter/index.html

Hello,

thanks, I think this is the best solution. I must try it within the next days.

Hi,

I used Einhugur ExcelWriter in the past and moved to MBS XL plugin, IMHO more powerful and flexible, to generate XLS(X) files. However I’m not generating charts, you should ask @Christian Schmitz for details.

[quote=405148:@Olivier Colard]Hi,

I used Einhugur ExcelWriter in the past and moved to MBS XL plugin, IMHO more powerful and flexible, to generate XLS(X) files. However I’m not generating charts, you should ask @Christian Schmitz for details.[/quote]

The MBS plugin requires a licence for LibXL, which costs $199 per platform or $1,399 for an enterprise licence, where as the Einhugur ExcelWriter requires nothing of the sort.

Manfred
My web app is using the excel class and is running as a service on Windows server. The trick was to get the service log on settings correct. This setting is in the properties of the service.
Are you setting up the service using SC ?
Thanks

Hello,

yes, I use the sc command. Can you tell me your trick, please?

This the setting that worked for me. There may be security risks involved with this setting so use at your own risk.
In the properties of your service go to the Log On tab, check the Local System Account and check the Allow service to interact with desktop.
Or you can set a specific account user and password as long as that account has proper permissions. Usually admin permissions.
Thanks

I am sorry for the LibXL price, but they didn’t give me a deal to pay once for everyone.
So you need the library and it’s really a good and comprehensive one.

Does more than Björn’s class.

You can download MBS Xojo XL Plugin and try it before you buy. Check the examples!

Hello Gary,

thank you for the options. Here, they don’t work. Maybe there is a special configuration on the server which depends from using this option. The VM is not my personal one.

On the other hand I tried today the einhugur plugin and this works fine. I think the better way, because I don’t need the communication with Excel. And this may fail and because it is on the server I don’t see it immediately. And also this way is more quick while exporting. Now, I have to tell it my manager to buy the plugins :wink:

And also very much thanks to all who replied to my question.