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

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

newFile.zip (2.6 KB)

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

@Arun_Pondhe

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)

image

@Arun_Pondhe

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.

@HareeshMR

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

@Arun_Pondhe

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

Regards,
Hemal