I am opening 4 different xlsm files that ran a macro. The macro reads data from the cells. The macros work individually but together they get messed up. because
Cells(1, 1).Value
is taken from the active sheet and not from the sheet I want .
Is there anyway to spicify a sheet like
workbook("example1").sheet("sheet1").Cells(1, 1).Value
workbook("example2").sheet("sheet1").Cells(1, 1).Value
?
Edit : (thanks Gimp) I tried
Dim oWorkSheet As Worksheet
Set oWorkSheet = Workbooks("example1.xlsm").Sheets("sheet1")
oWorkSheet.Cells(1, 1).Value
and got a run time error
"Object doesn't support this property and method"