LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing value to specific Cell in Excel Sheet Using ActiveX in LabVIEW

Solved!
Go to solution
 

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

0 Kudos
Message 1 of 11
(8,448 Views)

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

0 Kudos
Message 2 of 11
(8,418 Views)
Solution
Accepted by ShazRahath

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.

0 Kudos
Message 3 of 11
(8,407 Views)

Hi Bob,

 

I tried the same witht report genearation toolkit. Still, some error is showing. Please help on this if possible.

 

Thanks,

 

Shaz Rahath

0 Kudos
Message 4 of 11
(8,363 Views)

@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.

 

0 Kudos
Message 5 of 11
(8,339 Views)

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

0 Kudos
Message 6 of 11
(8,333 Views)

@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.

 

 

 

 

0 Kudos
Message 7 of 11
(8,328 Views)

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

0 Kudos
Message 8 of 11
(8,307 Views)

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.




Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 9 of 11
(8,279 Views)
Solution
Accepted by ShazRahath

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

0 Kudos
Message 10 of 11
(8,267 Views)