LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

rearrange excel sheet numbers

Solved!
Go to solution

Hi all,

 

I want to rearrange the excel sheet.
For example, i want to move sheet 2 to position 5.
I've searched in various ways, but I can't find it.
If you know how, please help me.
I would be grateful if you have a sample file.

 

Thanks

0 Kudos
Message 1 of 12
(2,545 Views)

Hi,

It is always better to share the piece of code that you have tried to guide you in a better way.

 

How you are trying to achieve? Report Generation ToolKit/Excel ActiveX?

 

If you are using ActiveX Please find the function available to achieve to move sheets you can specify the index/Sheet Name for before/After (Optional)

 

PalanivelThiruvenkadam_0-1635490142883.png

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 2 of 12
(2,530 Views)

Thank you very much for your reply. 

 

As your capture image, i just using the Excel ActiveX.

 

As shown in the image below, it is not possible to select an action item(i don't know that why cannot selecting), but the configured Invoke Node works well.

 

If possible, would you like to share a sample file?

 

explorer74_0-1635495923463.png

Thank you and good day.

 

 

0 Kudos
Message 3 of 12
(2,505 Views)

Share the code which you have tried (Please Share LV 2017 version)

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 12
(2,502 Views)

This is a LV 2013 version.

0 Kudos
Message 5 of 12
(2,500 Views)

You are, in fact, using the Report Generation Toolkit, which is designed to free you from the "confusion" (to me) of ActiveX.  With the Excel Get Worksheet function, you can open any of your WorkSheets by name or by number.  With Rename Worksheet, you can change the name of an existing Worksheet.

 

If what you want to do is "shuffle the order" of the (existing) Worksheets, I have a great tool for you that will greatly simplify this process -- Excel itself.  You can drag and drop the Worksheet "Tabs" until you get the order you'd like.  Otherwise, you can use the Worksheet VIs in the RGT to open whatever Worksheet you need to use.  There is even a function in there to tell you how many Worksheets you have (Excel Worksheet Properties).

 

Bob Schor

0 Kudos
Message 6 of 12
(2,491 Views)

Take Bob's comment to heart. Often times the best way is to just use the software itself. But there's always that chance that someone wants to do this programmatically for many Excel files. That being said...

 

This can technically be done programmatically in LabVIEW but there is a fairly large caveat: an index is associated with a worksheet when it gets created, and cannot be changed. So if you create 6 worksheets and move them all over, their indices will still be numbered in the order they were created.

 

Spoiler
Rearrange Excel Sheets.png
Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

Message 7 of 12
(2,431 Views)

Thank you very much.

 

I also want to solve the root cause, but I am still searching for it because I do not have enough knowledge.

I don't know why ActiveX doesn't work with Excel.
If you have any experience related to this, please share.

 

Dear FireFist-Redhawk,

 

I just use the LV 2013 version, so cannot open example file.....

If possible, please downgrade to LV 2013 version and share again..

 

Thank you for your kindly explanation and help.

 

Thank you.

0 Kudos
Message 8 of 12
(2,413 Views)

Did you look at FireFist-Redhawk's "Spoiler"?  It consists of a picture of the code in the LabVIEW 2017 VI that you can't open.  But if you open your copy of LabVIEW 2013, you can re-create FireFist's code by identifying the LabVIEW functions in the Spoiler, putting them in your own LabVIEW 2013 VI, and connecting them with wires as FireFist showed you.  For example, the first VI is "New Report" (which might have been called "Create Report", but you can look at all of the VIs shown on the RGT Palette and choose the one that "looks right").  

 

Try this code and see if/how it works.  You should be able to do this all by yourself ...

 

Bob Schor

0 Kudos
Message 9 of 12
(2,405 Views)

Everybody thank you for your help.

 

I find out the root cause for my labview problem.

 

There is a similar case as shown in the link below, and it works well when the solution is applied.

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KZNSA2&l=en-US

 

Thank you and have a good day~

0 Kudos
Message 10 of 12
(2,396 Views)