08-17-2012 04:46 AM
There are many threads regarding usage of MS office with LV, but I was not able to find the answer to the following question. I hope somebody can help or point me to a useful thread.
I have an excel template file and would like to create new reports each time from it. There are a couple of solutions for this problem which are fine. But, at the end, I am going to build an application and install it on an industrial PC which does not have MS office installed. The question is if the application works on the target machine as well.
I am specifically pointing to the solution in here which uses ActiveX reference to Excel._Application. Any chance that this solution or any similar one works on my target PC?
If you wonder why I want excel reports on a machine that does not have MS Office, I should say that the reports are just stored somewhere on the disk to be transferred later to headquarters let say!
Developing machine: Win7, LV8.6 Pro + Report generation toolkit
Target machine: WinXP SP3, LV run-time engine
Thanks in advance!
Soroush
Solved! Go to Solution.
08-17-2012 06:09 AM - edited 08-17-2012 06:10 AM
You need to have Office installed on the computer that is running the LabVIEW application. It is the Office applications that provide ActiveX functionality to the Report Generation Toolkit. Without them, LabVIEW has nothing to interface to.
http://digital.ni.com/public.nsf/allkb/02E339E26484F30186256E920061FBD9
08-17-2012 06:31 AM
Fair enough! Thanks.
08-22-2012 05:35 AM
Good News! It is possible.
More accurately, it is possible to open an unprotected xls file and update contents of the cells.
See the solution here. Look under LabVIEW, and into the 3rd paragraph.
The only modification I needed was to install Microsoft Access Database Engine Redistributables 2007 instead of 2010 version.
Hope it helps somebody!
07-30-2013 10:28 AM
Hi,
I wonder if there is a similar way to create XSL files? I read that with Microsoft Access Database Engine one can only transfer data between existing Microsoft Office files (so read and write data). In certain circumstances my app has to create new file.
This is not a problem if MS Office is installed, but I cannot be sure that it will be on all machines.
Is it OK to add an empty document to project and then use it? Whenever I needed new document I would make a copy of that empty file.
Any ideas?
Thank you.
07-30-2013 10:59 AM
@gtu wrote:
[...]
Is it OK to add an empty document to project and then use it? Whenever I needed new document I would make a copy of that empty file.
Any ideas?
Thank you.
I've seen that done before. Seems sound to me.
07-30-2013 12:43 PM
gtu,
In my case, I had made an empty XLS file on my development PC with Microsoft Office installed. More accurately, it was an empty template for a report that only needed insertion of data to become a nice complete report. I did not have Microsoft office on my deployment machine, but every time I needed a new report, I began by copying the template and renaming it by attaching date and time string to the original file name. The rest is just editing the copied file and inserting some data into the specific cells. Of course, this works only if you have a fixed template for the XLS files you want to create.
To make a copy of any file, you can just use LabVIEW.
Soroush
07-31-2013 01:41 AM
thankyou