LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Append Report Text VI - Assign MS Office Parameters

Solved!
Go to solution

Hello,

 

I am working on a project and want to reuse the VI attached.

 

However, the problem is that the ROW and COLUMN are constants.  Is there a way to make these variables so I can assign values to them in the top level VI?

 

Thanks

Rich

0 Kudos
Message 1 of 4
(1,266 Views)

Can you use File -> Save for Previous and save it in, say, 2018? A lot of people don't have LV 2021 yet.

0 Kudos
Message 2 of 4
(1,244 Views)
Solution
Accepted by topic author Comelit2022

You need to learn a little more LabVIEW.  Do you know about "Clusters", the method of grouping various data elements into a (usually named) group, similar to a Pascal "Record" or a C/C++ "Struct"?  The Cluster constant "MS Office Properties" is, indeed, a Constant, which you need because it defines the Cluster.  Do you know about the "Bundle by Name" function, which takes a Cluster (Constant or variable) and "exposes" elements that let you "redefine" (or "input") your own values?  Here's what it looks like (from your example):

MS Office Parameters.png

 

As you can see, I "broke" the wire from the MS Office Parameters cluster (the structure on the top right of the Snippet) and wired it into a Bundle-by-Name Cluster function.  The first element originally said "position (Excel)", but I clicked on it and chose to expand it (it was also a Cluster) and show its elements called "row" and "column".  I then wired my own variables (imaginatively-named "My Row" and "My Column").  When you run this, now, the code will use the values you choose for My Row and My Column to replace the "5" and "1" shown in the original Cluster.  Incidentally, I think (5, 1) corresponds to Cell B6 (rows are numbered, columns are lettered, and the first "index" is 0, not 1).

 

Bob Schor

 

P.S. -- I never use the "Append Report" functions; I find the "Easy Report" versions much "easier" (and more flexible) to use.  I posted a "Revised Excel Report Example" here on the Forums about 8 years ago -- you can find it easily if you search, starting with the word "Revised" that may prove useful.

Message 3 of 4
(1,228 Views)

Hi Bob,

 

Yes I am still quite new with GCode but I've dabbled with Python in the past so fortunately I am familiar with structures and your solution has triggered exactly what I needed to see!  I'll also take a look at 'easy report' and your example.  I have seen the bundle function used in a few tutorials but I've never used it.

 

I will try and get it working using both methods, but if the 'easy report' is nicer to use I will go down that path.

 

Thanks

Richard

0 Kudos
Message 4 of 4
(1,222 Views)