There are plenty examples on the web and shipped with LabVIEW on how to use Excel. But once you start developing more or less complicated applications you start dealing with sharing Excel instances with other Users, programs and within the application itself.
Below I would like to share my solution to Excel sharing in multi-user environment.
In future it would be really nice if: native LabVIEW Automation Open allows us to request instance by name or ID, not just new or unknown instance.
Built-in Excel features used:
Concept:
A storage VI with 7 modes:
Mode/Command | Description | Usage |
---|---|---|
List All | Lists all active (obtained by this vi) Excel instances | normal(default) |
Open New Instance | Opens new instance of Excel Application | normal |
Get Instance by Name | Gets active LabVIEW's Excel App. RefNum | normal |
Close Instance by Name | Closes active instance by Name | normal |
Close instance by RefNum | Closes active instance by RefNum | normal |
Kill All | Kill's all active Excel instances (global process kill command) | house cleaning |
Close All | Closes all active LabVIEW"s Excel instances | normal |
Simple Example provided.
04/26/2011 Update:
04/27/2011 Update:
05/02/2011 Update:
Bug found in Close by RefNum.
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.