Invoke VBA help

Hi Friends,

I want to add a macro to a excel file, that will be opened with an excel application.

The macro will do text to columns that’s all. See below the example:

How can I combine the macro like below with the "Invoke activity. Could please someone explain me this or share a example?

’ Macro1 Macro

Sheets(“Sheet 1”).Select
Columns(“L:L”).Select
Selection.TextToColumns Destination:=Range(“L1”), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns(“M:M”).Select
Selection.TextToColumns Destination:=Range(“M1”), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns(“N:N”).Select
Selection.TextToColumns Destination:=Range(“N1”), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True
Columns(“O:O”).Select
Selection.TextToColumns Destination:=Range(“O1”), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=False, Space:=False, Other:=False, FieldInfo _
:=Array(1, 1), TrailingMinusNumbers:=True

Sorry, are you using Invoke VBA or Excel macro?

Invoke VBA

Input: Codefilepath, put here the directory to the txt file with the Macro in it.
EntryMethodName: Put here the name of the macro

Then you should save this code in a file, see example here:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.