LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Vs. Excel help

I have made an excel sheet using excel
.
can someone guide me into changing the excel worksheet labeled "chat1, 2,3, etc." to be rename to anything i want?
i used the activeX method
Best regards,
Krispiekream
Download All
0 Kudos
Message 1 of 11
(4,190 Views)
An excel sheet (Chart, Worksheet, etc) object has read/write "Name" property which is the text on the sheet tab.  The following Excel VB code lists the sheet names in a workbook to the Immediate window:
 
Sub ListSheetTabNames()
    Dim i As Integer
    For i = 1 To Sheets.Count
        Debug.Print Sheets(i).Name
    Next i
End Sub
 
If you have a reference to the chart you have created, you should be able to change the Name property for the chart.
Message 2 of 11
(4,164 Views)
i dont know how to use VB codes in labview.
do you have any picture?
any diagram?
thanks

Best regards,
Krispiekream
0 Kudos
Message 3 of 11
(4,144 Views)
thank you, but i have figured out with your help!


Message Edited by krispiekream on 11-14-2007 03:42 PM

Message Edited by krispiekream on 11-14-2007 03:49 PM
Best regards,
Krispiekream
0 Kudos
Message 4 of 11
(4,136 Views)

I have attached a VI that uses the "Name" property of a worksheet object to change the tab name.  It is a bit horrible to look at but this is automation in LabVIEW - not always pretty!

The VI does the following:

1.  Open an instance of the Excel Application object and makes it visible (for some reason, if you use automation to create an instance of Excel to work with, it will be created with the visible property set to false - go figure.

2.  Add a new workbook to the Workbooks collection.

3.  Add a new worksheet to the new workbook's Worksheets collection.

4.  Use the worksheets "Name" property to retrieve and display the created worksheet's name

5.  Uses the "Name" property to rename the sheet tab.

6.  Uses the "Name" property to retrieve and show the new name.

If you are doing a lot of automation of Excel, I would get a good book on programming Excel that describes the automation interface.  John Walkenbach has written several good ones.  (http://j-walk.com/ss/)

-cb

Message 5 of 11
(4,121 Views)
i forgot to mention that i am using labview 8.0.
can you save for previous version?
thank you!

Best regards,
Krispiekream
0 Kudos
Message 6 of 11
(4,116 Views)
Message 7 of 11
(4,111 Views)
NICE!!!
I looks great.
Its very similiar to what I used, but yeah, it is very useful!
Best regards,
Krispiekream
0 Kudos
Message 8 of 11
(4,102 Views)
Hi everyone..
Can someone please save this for LV7.1?
Thanx very much guys..
0 Kudos
Message 9 of 11
(3,779 Views)

Hi I_Pant,

attached is a picture of it.

Mike

0 Kudos
Message 10 of 11
(3,749 Views)