meniyk
asked on
Excel VBA - How to call module procedure from Workbook Object after instanciated
Hi,
Is there a way to call and function module from the workbook object after instanciated based on the below scenerio...
The Book1.xlsm contain the macro that open up the Book2.xlsm and is set to workbook object.
e.g
Book1.xlsm
Module1
sub openfile()
Dim wb as Workbooks.
Set wb= Workbooks.Open("C:\test\Bo ok2.xlsm", ReadOnly:=True)
wb.module1.test '<-- how to call the procedure in his own module
wb.module1.test1(wb) <-- how to call the procedure in his own module
End sub
*************
in Book2.xlsm
Module1
sub test1()
msgbox ("Hi")
end sub
sub test2( wb as workbooks)
bla bla bla...
end sub
Thank you.
best regards
YK
Is there a way to call and function module from the workbook object after instanciated based on the below scenerio...
The Book1.xlsm contain the macro that open up the Book2.xlsm and is set to workbook object.
e.g
Book1.xlsm
Module1
sub openfile()
Dim wb as Workbooks.
Set wb= Workbooks.Open("C:\test\Bo
wb.module1.test '<-- how to call the procedure in his own module
wb.module1.test1(wb) <-- how to call the procedure in his own module
End sub
*************
in Book2.xlsm
Module1
sub test1()
msgbox ("Hi")
end sub
sub test2( wb as workbooks)
bla bla bla...
end sub
Thank you.
best regards
YK
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@andrewssd3
Great input. We never cease to learn it opens up new horizons. Tks again for your valuable input.
gowflow
Great input. We never cease to learn it opens up new horizons. Tks again for your valuable input.
gowflow
ASKER
Greatly appreciate you response and contribution.
That's amazing, Andrewssd3 manage to reslove my the problem and very well explain the concept. Once again Thank you Andrewssd3. Point has been mostly rewarded to Andrewssd3.