02-12-20 11:21 AM
02-12-20 01:57 PM
' Inputs: Handle (number), Macro Name (text), Parameters (collection)
' Outputs: Return Value (text)
'
' Package any arguments to pass into a single-row collection.
If Parameters.Columns.Count = 0 Then
Return_Value = GetInstance(Handle).Run(Macro_Name)
ElseIf Parameters.Rows.Count < 1 Then
Throw New Exception("Parameters must contain at least 1 row")
ElseIf Parameters.Columns.Count = 1 Then
Return_Value = GetInstance(Handle).Run(Macro_Name, Parameters.Rows(0))
ElseIf Parameters.Columns.Count = 2 Then
Return_Value = GetInstance(Handle).Run(Macro_Name, Parameters.Rows(0), Parameters.Rows(1))
ElseIf Parameters.Columns.Count = 3 Then
Return_Value = GetInstance(Handle).Run(Macro_Name, Parameters.Rows(0), Parameters.Rows(1), Parameters.Rows(2))
ElseIf Parameters.Columns.Count = 4 Then
Return_Value = GetInstance(Handle).Run(Macro_Name, Parameters.Rows(0), Parameters.Rows(1), Parameters.Rows(2), Parameters.Rows(3))
ElseIf Parameters.Columns.Count = 5 Then
Return_Value = GetInstance(Handle).Run(Macro_Name, Parameters.Rows(0), Parameters.Rows(1), Parameters.Rows(2), Parameters.Rows(3), Parameters.Rows(4))
Else
Throw New Exception("Parameters cannot contain more than 5 fields")
End If
02-12-20 04:01 PM
02-12-20 05:54 PM
03-12-20 10:19 PM
Hi Janani
Well at very first you need to tweak the macro to pass arguments like Macroname(filepath as string). Once that is done one needs to enter the below code stage in excel vbo
GetInstance(Handle).Run(Macro_Name,Param1)
you have to pass 3 inputs
1. handle
2. Macro name
3. Param1 'pass file path as a variable into param1 as input
04-12-20 12:42 PM
Thanks Susamy Halder.. Will try this logic
Regards,
Janani PR