10-09-2015 03:26 AM
Hi,
I need some help to insert some data to specific cells in Excel In LabVIEW. Im using Active-X for executing this. Its show errors while running it. Errors are attached in this post. But. while running it in"Highlight Execution mode", it shows no errors. Please help me on this.
Is there any alternative method other than using Active -X for writing data to specific cells. Thanks in advance.
Shaz M Rahath
Solved! Go to Solution.
10-09-2015 07:32 AM
LabVIEW 2014 includes the Report Generation Toolkit. With this, it is very easy to write to a specific cell in Excel. There are numerous examples that illustrate how to do this, including several in this forum (one of which I posted almost two years ago).
Bob Schor
10-09-2015 07:48 AM
Shaz,
You are opening a single reference to a worksheet and then in parallel you have multiple instances of 'Close Reference.vi' racing to close the same reference. As soon as one of the instances closes the reference the rest of the code is broken.
10-12-2015 02:11 AM
Hi Bob,
I tried the same witht report genearation toolkit. Still, some error is showing. Please help on this if possible.
Thanks,
Shaz Rahath
10-12-2015 08:13 AM
@ShazRahath wrote:
Hi Bob,
I tried the same witht report genearation toolkit. Still, some error is showing. Please help on this if possible.
Thanks,
Shaz Rahath
Did you bother reading the error message?
It says that the cell is protected.
10-12-2015 08:18 AM - edited 10-12-2015 08:32 AM
HI,
Sorry for that image. I changed the cell protection. Even aftert that its showing different error. When i give only two cells, its showing no error. when i add all the other elements (cells) its showing error. Pls find the attached error image.
Error 1 occurred at Incorrect function.
in Write to Excel - Specific Cells.vi
Possible reason(s):
LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
=========================
NI-488: Command requires GPIB Controller to be Controller-In-Charge.
Thanks and regards,
Shaz Rahath
10-12-2015 08:20 AM - edited 10-12-2015 08:21 AM
@ShazRahath wrote:
HI,
Sorry for that image. I changed the cell protection. Even aftert that its showing different error.
Thanks and regards,
Shaz Rahath
Then you should have attached the JPG of the new "different" error.
Also, have you done anything to follow Wayne C's suggestions?
I would suggest that you actually do some work to try to fix this problem.
10-12-2015 08:41 AM
Hi,
I tried all the possibilities suggested. I didnt understand the Wayne C's suggestion. if i am supposed to open each reference for every worksheet , then every time the excel repoens and saves the data repeatedly. I tried to put close reference individualy for each reference as per Wayne C's suggestion. But, its showing this error. Please reply.
Error 1 occurred at Incorrect function.
in Write to Excel - Specific Cells.vi
Possible reason(s):
LabVIEW: An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.
=========================
NI-488: Command requires GPIB Controller to be Controller-In-Charge.
Thanks in advance,
Shaz Rahath
10-12-2015 10:21 AM
These questions have been answered many time in this forum. Please have a look at the LabVIEW examples there is one that is called Write table to Excel. That will hekp you out. For more information and some sample VI's and tool kits, you can go to the excel board.
10-12-2015 11:13 AM
When I ran you code, the Error tha LabVIEW popped up was that the requested cells were "protected", or Read-On\ly. removing the Protection enalbed the code to run and "do what you expted". I changed to two Cell Contets to Newer and Newest, and put the second Easy Table after the first, connecting it to the Passthrough Report Object and Error Line wires.
I hope you agree (once you fix the bug in the data, not in your code) that this little piece of code is much easier to understand (and modify) than is ActiveX.
Bob Schor