Invoke VBA throwing error

Hi everyone!

During a process I’m getting an error when invoking VBA using Modern Excel activities.
I’m running the VBA code in order to delete all the hidden rows in the file (about 70k).

The error is the following:
Invoke VBA: In order for this activity to work, Trust Access to the VBA project object model must be enabled from Excel (File > Options > Trust Center > Trust Center Settings > Macro Settings > Select the Trust Access to the VBA project object model check box)

I’ve already made sure that Excel is correctly set but I still get the error.
I’m attaching the piece of the sequence where I’m invoking the VBA as the code itself. I’m also attaching a screenshot of my Excel where the settings can be seen.

I’ve tried to use For Each and Delete Hidden Rows activities but they take too long due to the amount of rows to be deleted. The size of the file also makes hard to me to use it as a datatable to filter it afterwards. So my last thought was the VBA code.

Any help is welcome :slight_smile:

Many thanks!
VBADeleteHiddenRows.txt (245 Bytes)

HI @roberto.piccolli

Have You added Trusted Location?


HI @Sudharsan_Ka

Thank you for the response.
I’ve found out that the issue in fact was with the method I was adding in the Invoke VBA activity. Now using DeleteHiddenRows method it doesn’t fail anymore.

The process is still really slow. It took over 2 hours to delete 70k rows via VBA. Is there any way I could speed up this process?

The file has in total 350k rows and 102 columns.

Thank you!

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