Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you run an Excel macro from Labview?

I am trying to run an Excel macro from labview.  My program is fairly simple, I just want to be able to format a spreadsheet created by a data acquisition program.  I have seen the example that shows how to do this process, but their method does not seem to work for my application.  Preferrably, I would like to run a macro from the personal.xls workbook embedded in Excel that could be accessed from a variety of applications, but I do not understand how labview is supposed to call a macro.  Has anybody had any experience with this?  Included is my vi and a small snippet of the code associated with the macro I want to run.  I have also tried putting this macro in a separate workbook from personal.xls, one that is in the same folder as the vi, but to no avail.  Thanks...
 
Some of the code I want to run in my macro:
 
Sub CleanTempFiles()
    Range("A1").CurrentRegion.Select
    With Selection
        .HorizontalAlignment = xlCenter
        .NumberFormat = "0.000"
    End With 
End Sub
0 Kudos
Message 1 of 1
(2,816 Views)