01-25-2016 03:36 PM
Hi everybody,
I try to use the Excel Report - Run Macro VI with a VBA Macro (My_Macro) structured as follow :
Sub My_Macro(A, B, C, D)
Dim Chart_name() As String
.....
End Sub
Function blabla()
...
End Function
In the code I build an array of strings and I would like this array to be returned to Labview. I do not know how to do that.
When I write Sub My_Macro(A, B, C, D) As String the code does not run anymore.
Please could you help with this.
Cheers,
01-25-2016 04:09 PM
Can you post your VBA code that builds and returns the array?
01-25-2016 04:33 PM
Assuming this is your VBA code in a workbook called Book2.xlsm:
Function Macro1() ' Dim StringArray(1 To 2) As String StringArray(1) = "Test" StringArray(2) = "Test3" Macro1 = StringArray End Function
This Labview code should run and return an array with those values.
01-26-2016 02:04 AM
Hi aputman,
Thank you for your answer.
I found on the internet that it was not possible to return something with Sub() in VBA so I used Function() instead ans it works.