03-10-2016 03:53 AM
Hi guys!
Is it possible to merge cells, insert and change images into specific cells and set their orientation (snap to cell grid) via LabView directly?
Or do I have to make a VBA macro and call that from LabView?
Thanks!
03-10-2016 06:58 AM
Yes you can.
You can use ActiveX nodes in LabVIEW that work like the properties and methods in Excel to work on the cells the same way.
Search the Example Finder. Also look through the message of links in the Excel board to find some good examples.
03-10-2016 09:04 AM
Here's an older post with some VIs attached, not sure if the ActiveX commands have been updated/changed since then.
03-10-2016
09:15 AM
- last edited on
04-14-2025
03:46 PM
by
Content Cleaner
It is far easier to use one of the third party Excel add-ons like XLR8 https://www.ni.com/en-us/shop/product/xlr8.html
Sure it seems expencive but you do not need Excel installed on the target machine like using Direct-X or NI-Report Generation for Excel VI's.
03-10-2016 09:37 AM
As the others have stated, you can probably find a way to do what you want with a fair bit of effort. If your report looks similar every time though, you can format a template excel sheet that has all the formatting you are going to need. Then if you create a new report with the report generation toolkit, you can load up this template sheet.
03-10-2016 09:50 AM
If you are using LabVIEW 2014 or 2015, or have the Report Generation Toolkit installed on an older version of LabVIEW, there are functions in the RGT that will do some formatting and other things for you. For example, I wanted to highlight a row in an already-colored (background) WorkSheet (being used as a Read-Mostly list of parameters for a Behavioral Trial), so I chose to color the Cell Entries (text) Red and Bold, returning them to Black and not Bold when I chose another row. The function that does this is called Excel Set Cell Font. I've pasted a 2015 Snippet below. One caveat -- you need to know how many columns there are in the Worksheet (the sub-VI "Row Limits" figures this out for me).
Generally, you use LabVIEW to do simple reads or writes. If you really need fancy formatting, some is definitely possible, but as Gregory notes, you might have an easier time if the formatting remains constant creating a Template into which you can place your data.
Bob Schor