Error calling a macros, filepath issue?

Hi Guys,

My macro runs fine manually.
Its stored in my personal workbook, the workbooks im trying to run the macros on are in OneDrive personal.
Please find the error below.
Sorry, we couldn’t find C:\WINDOWS\system32\PERSONAL.XLSB.

This isnt where my macro is stored.
Ive attached a screeenshot, hope it helps.
Is it a filepath issue ?

Thanks guys.

Right, it was a filepath issue.
Put single quotes before C and ! in file path.

string.Format(“C:\Users\michael\AppData\Roaming\Microsoft\Excel\XLSTART\PERSONAL.XLSB!Third_Refresh”)

string.Format(“‘C:\Users\michael\AppData\Roaming\Microsoft\Excel\XLSTART\PERSONAL.XLSB’!Third_Refresh”)

Workbook opens, macro runs but doesnt update the tables etc.
Thoughts ?

Thanks

Hello,

So if I understood correctly you are iterating through some excel files and you are calling a macro that is stored in those excel files or are you trying to execute a macro which is stored in a different excel file to modify the initial excel files :slight_smile:

Regards,
Dragos.

Hey buddy,

The macro(s) are stored in my excel personal workbook, which is stored in my desktop.
The excel files im running the macros on are stored in OneDrive.

The same automation works perfectly fine in Power Automate Desktop so macros are working correctly, also work manually.

Am I correct with the single quotes in the post above ? I read it from another post.

Thanks