Run macro in workbook from PERSONAL.XLS

B

Brettjg

Hello out there,I'm running a macro from PERSONAL.XLS and from there I want
to run a macro that resides in the Activeworkbook (which has a variable
name). I've tried a few different combinations but can't quite get it right.

Application.Run (ActiveWorkbook("HIDE_LOAN_LINES"))

Regards, Brett
 
D

Dave Peterson

dim wkbk as workbook
set wkbk = activeworkbook
application.run "'" & wkbk.name & "'!hide_loan_lines"

You could drop the variable stuff, too:

application.run "'" & activeworkbook.name & "'!hide_loan_lines"

But I like the variable.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top