PDA

View Full Version : Call a sub from another open workbook



DevanG
06-21-2011, 05:36 AM
so, i open up a workbook. Then I want to run a sub that is in the code of that workbook. This is what I have and it doesn't work.

Application.Run "'Copy of DBM & IOM.xls'!TransferQuote"


or... application.Run "'name of file'!name of sub"

Kenneth Hobs
06-21-2011, 07:11 AM
e.g.
Application.Run "'" & ThisWorkbook.Path & "\RunExample.xlsm'!Module1.Button807_Click", 3

DevanG
06-22-2011, 07:16 AM
nvm I got it. thanks.

it goes application.run "'file name'!modulename.subname"

Capungo
10-13-2011, 07:30 AM
This question and this answer changed my point of view in many Excel projects...

Thank you both very much...