Error is come for invoke VBA Can anyone help how i can use vbs file for excel splitting

That you have to change in the excel @Arun_Pondhe

Open the excel file and change it

File → Options → Trust Center → Trust Center Setttings → Macro Settings → Trust Access to the VBA Project object model.

1 Like

@HareeshMR After changes still not working showing Macro error

Can you post the recent error you are getting @Arun_Pondhe

1 Like

are you sure u have “Main” function in newFile.txt?

Can you try enabling the macros in the excel @Arun_Pondhe

Seems the macros are disabled and check the function name in the code. if possible post the screenshot of the code or add the code file (2.6 KB)

I want workflow for these code file if possible please tell me any idea


Please change “Main” to “Button1_Click” and try to run it again

The error occurred because you call not exist macro (you marco name is Button1_Click)



As @Natapong mentioned in the above post, the function name is invalid. please try changing that

and why don’t you save the file with .vb extension instead of txt.


Thank you for your advice , i mistake about it.
I’m using .txt because Invoke VBA activity can call .txt file and run code normally

1 Like

yeah not at all a problem with .txt file also @Natapong

I just reminded that, storing the file with .vb extension will help us to know it is a macro file. thats it :slight_smile:. It will work with both the files.

Thank you and glad to meet you online :slight_smile:

1 Like

not working after enter Button1_Click


Could you please share the details in [FileocVB.vbs] files.

Please try running the macro in the excel manually and check if it is working fine @Arun_Pondhe

@HareeshMR manually working fine but using activity it’s not work

Hi @Arun_Pondhe,

Let me know if your file is enabled with macro?
Go to trusted settings and enable all macros in excel sheet.
Check Trust access to VBA process settings.
In Active x enable all settings