HughLerwill
Programmer
Dear all,
Further to thread707-1332233 I've been trying to get the third verse of this to work, without any luck.
Sub RunMac()
'This macro in Book1
'Book1, Sheet1 is active
'call function in sheet of foreign WorkBook - works
ActiveSheet.Cells(1, 1) = Workbooks("Book2.xls").Worksheets(1).myfunction1(1)
'call function in ThisWorkBook of foreign WorkBook - works
ActiveSheet.Cells(2, 1) = Workbooks("Book2.xls").myfunction2(2)
'call function in MyModule of foreign WorkBook - will not work
'ActiveSheet.Cells(3, 1) = Workbooks("Book2.xls").VBAProject.MyModule.myfunction3(6)
End Sub
The myfunction1, 2 and 3 procedures in Book2 are all Public
Can anyone tell me the correct syntax.
regards Hugh,
Further to thread707-1332233 I've been trying to get the third verse of this to work, without any luck.
Sub RunMac()
'This macro in Book1
'Book1, Sheet1 is active
'call function in sheet of foreign WorkBook - works
ActiveSheet.Cells(1, 1) = Workbooks("Book2.xls").Worksheets(1).myfunction1(1)
'call function in ThisWorkBook of foreign WorkBook - works
ActiveSheet.Cells(2, 1) = Workbooks("Book2.xls").myfunction2(2)
'call function in MyModule of foreign WorkBook - will not work
'ActiveSheet.Cells(3, 1) = Workbooks("Book2.xls").VBAProject.MyModule.myfunction3(6)
End Sub
The myfunction1, 2 and 3 procedures in Book2 are all Public
Can anyone tell me the correct syntax.
regards Hugh,