LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I cut and paste an excel spreadsheet using NI's New Microsoft word & excel report generation toolkit?

We generate huge bodies of data using LabView and generally spend 100's of hours crunching it down using spread sheets. We purchased NI's Microsoft Word & Excel report toolkit which has all kinds of VI's for dealing with Excel and Word. I can get my data into the spreadsheet, can sort and add formulas to cells. However I wind up with lots of blank cells which I can't figure out how to get rid of. Also I can't cut and paste from worksheet to another. How can I accomplish these tasks?
0 Kudos
Message 1 of 6
(3,075 Views)
Hello Father Priest,
I think that your posting has two main questions. The first is that you are getting some empty cells when populating your excel spreadsheet, why?, and the second is that you'd like to copy one worksheet to another, how?.
The first question is hard to answer because there is no reason why if you populated a cell with data, that the data is not there. I would check your code to make sure that the cells that you are populating are the ones that you are selecting.
The second question can be answered, and there are a couple of different ways that you can perform this action. The first, and easiest way to copy a worksheet to another worksheet is to actually create a macro in Excel that selects a worksheet, selects all cells, copies the sel
ection, then selects the next worksheet, and pastes the data. You can make this macro using Microsoft Excel's Macro Creation tools. You can make your own Excel Macro by going to Tools>>Macro>>Record New Macro. Then you just start recording actions, perform the actions that you would like the macro to perform, then stop the macro with the Macro Editor's stop button. Save the Macro. You can call that macro in your LabVIEW Program using the Report Generation Toolkit built-in VIs.

Your Macro's code will probably look something like this:
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 8/7/2001 by Dan Hoar
'

'
Sheets("Sheet1").Select
Cells.Select
Selection.Copy
Sheets("Sheet2").Select
Cells.Select
ActiveSheet.Paste
End Sub

But depending on what your worksheet names are, etc., it might look different.

I hope this helps you out. Have a great day.
-Dan Hoar
Applications Engineering
National Instruments
0 Kudos
Message 2 of 6
(3,075 Views)
how can i add formula to labview database....
other than n excel..or adding formula to table..
pls suggest a solution soon..
Regards

Tiju Thomas
0 Kudos
Message 3 of 6
(2,626 Views)
how can i add formula to labview database....
other than n excel..or adding formula to table..
pls suggest a solution soon..
Regards

Tiju Thomas
0 Kudos
Message 4 of 6
(2,625 Views)
Hi TIJU,
what do you mean with "add formula to labview database"? Do you want to calculate something in LabView?

Mike
0 Kudos
Message 5 of 6
(2,621 Views)
Hi TIJU,
 
Can you clarify what you are trying to do?  Are you using an Excel spreadsheet to do some calculations and you want to add more formulas to that?  Are you using a database and interfacing with it using LabVIEW?  If you can clarify exactly what you are trying to do maybe we can come up with a solution.  Thanks and have a great day!
 
 
Stephen S.
National Instruments
1 Test is worth 1000 expert opinions
0 Kudos
Message 6 of 6
(2,573 Views)