05-26-2014 07:53 AM
I've attached a Snippet that illustrates how to use the Report Generation Toolkit functions to allow you to create and/or append data to an Excel Workbook. Note that this writes "real Excel" (I'm using the .xlsx format, though you can also specify the .xls format by editing the file name), and doesn't (directly) require using or knowing ActiveX.
To run this, open LabVIEW (this snippet was made with LabVIEW 2012), and drag the .PNG file into the Block Diagram -- it should open as though it were a VI. Save it somewhere giving it a more User-Friendly Name (I chose "Excel Append Demo.vi"). Look at the False case of the Case Statement -- this is the code that creates the Excel file "from scratch" -- it differs from the Append ("True") case as follows:
This function generates 10 values at the rate of one per second (so don't panic when it seems to "stall" for 10 seconds) -- including the Timestamp in the Excel file demonstrates that the generated Excel entries come from multiple runs of the Demo.
Now run the Demo. When it finishes, open the Workbook that it generates. You should see a spreadsheet with columns labeled "Time" and "Value", and 10 data entries. Close the Workbook, and run the code again. Now you should see the same spreadsheet has 10 more rows appended to the original data. The more you run it, the more data gets appended.
Bob Schor
05-26-2014 07:55 AM
Oops, forgot to include the snippet ... explanation and instructions on previous post.
05-27-2014 06:14 AM
I have to admit I am not sure why you are getting this error. I have used this solution for years on development machines, test machines that range from desktops to laptops. I have also used the solution running Windows XP and Windows 7 on a mix of the machines mentioned before. Make sure you have the inputs correctly configured and that Excel is not open when trying to run this ActiveX solution.