I have written a macro in VBA that is working perfectly for my file. The problem is that when I am running this macro (of the same file) on a different computer, I get the following error:
Invalid procedure call or argument (Error 5)
... when executing .Item(0).Value
in the following code:
With CreateObject("VBScript.RegExp")
.Global = True
.Pattern = "([a-zA-Zá-ùÁ-Ù])(\d+)"
With .Execute(strText)
strRes = .Item(0).Value
I suspect that maybe something is dependent on the specific Workbook or file path (although I cannot find the dependency), but I cannot resolve this weird behavior.