Reputation: 1
We are upgrading a VB6 desktop app and I am investigating the possibility of converting it to a web app. However one of the main features of this app is that it automates Excel from the VB6 code; see Automation
Therefore, is it possible for a web app, either from server-side code (running on web server) and/or client-side code (running in web browser), to control an Excel executable running on the client's desktop?
The code will need to call on the Excel executable to manipulate Excel workbooks, set visibility of worksheets, unprotect worksheets, clear contents from ranges, as the user (an accountant) interacts with the web app and Excel.
ActiveX might be out of the question due to security reasons (https://msdn.microsoft.com/en-us/library/aa752035(v=vs.85).aspx) although it is an intranet app.
If this is not possible, are there alternative ideas to achieve similar results?
Upvotes: 0
Views: 252
Reputation: 37
Based on my Windows development experience, my suggestion would be to create a .net dll that will serve as an intermediary between the browser and Excel. This dll would host an embedded http or websocket server, depending upon whether your use case would be better served by utilizing the stateless request/response model or the persistent connection provided by a websocket. The embedded server would then be callable from your web application JavaScript through the provided xmlhttp functionality or an HTML5 websocket respectively. The .net dll would also provide the interface to Excel through .net's interop mechanism. Some issues to consider with these options are:
Some links to get you started:
I hope this helps.
Upvotes: 1