Hello everyone,
I am trying to execute a macro from another workbook after opening it with Workbook.open.
The macro works fine when I execute it after opening the workbook manually but whenever I open it from another workbook, I become the following error:
"VBA Runtime Error 1004 “Application-defined or Object-defined error" when I try to Access a named range.
Could someone give me some hints for the issue?
Thank you!
I am trying to execute a macro from another workbook after opening it with Workbook.open.
The macro works fine when I execute it after opening the workbook manually but whenever I open it from another workbook, I become the following error:
"VBA Runtime Error 1004 “Application-defined or Object-defined error" when I try to Access a named range.
HTML:
[CODE]
dim srcwb as Workbook, str as String
Set srcwb = Workbooks.Open(linkToWorkbook)
str = srcwb.Sheets(1).Range(rngName).value 'error 1004
[/CODE]
Could someone give me some hints for the issue?
Thank you!