NI產品與技術 討論區

取消
顯示結果 
搜尋替代 
您的意思是: 

modify x-axis display of an excel graph

Hi,

 

I'm want to use the excel report structure in LabVIEW.  I want to format the graph so that only the start and finish values appear on the graph in excel.  There doesn't appear to be a VI to do this. I also checked LabVIEW 8.5\examples\office\MSGraph Examples.llb but could not find this feature.

 

Does anyone know if there is anyway that I can do this using LabVIEW?

 

Thanks Sean

0 積分
1 條訊息(共 5 條)
5,865 檢視

labview report generation for microsoft office 不可能將所有功能包含進去,

 

所以有一個VI,excel run macro VI

 

http://zone.ni.com/reference/en-XX/help/372120A-01/lvoffice/excel_run_macro/

0 積分
2 條訊息(共 5 條)
5,863 檢視

So I guess the short answer is that LabVIEW does not have a VI to do this.

 

I tried the following macro:

 

Sub fun2()

    ActiveChart.Axes(xlCategory).Select
    With ActiveChart.Axes(xlCategory)

        .TickLabelSpacing = 1000
        .TickMarkSpacing = 500

    End With
End Sub

 

I works fine with a graph created in excel but doesn't work with the one created by the LabVIEW VI's. 

Unfortunately I am not an expert at VB macro's or indeed why LabVIEW is formatting in a strange fashion.  

 

Are the LabVIEW VI's useless?  Is it better to create ones own macro to create an excel graph?  I've wasted a lot of time so far but if anyone has any ideas I'd be delighted to hear them.  

 

Plan B is to create a template with the graphs already formatted and insert the numbers.  I don't want to do this the template is very big and time consuming to open  but in the absence of a better solution.....

0 積分
3 條訊息(共 5 條)
5,854 檢視

您的macro我這裡無法執行,可以提供完整的 macro code嗎?

0 積分
4 條訊息(共 5 條)
5,838 檢視

Hi Fatty,

 

Thanks for you previous reply.  You seem to be puzzled by the concept of macro code.

 

If a person create a macro to be run using the VI you suggested, the macro itself is composed of code.

 

If anyone can suggest code to modify the graphs created using NI's macro's I'd appreciate it.

 

Rgds,

Sean

0 積分
5 條訊息(共 5 條)
5,834 檢視