PDA

View Full Version : Solved: Run macro in another workbook without its name



realitybend
07-11-2008, 01:14 PM
I need to run a macro in the from a workbook. The macro I need to run is in another workbook (The active workbook). However, I don't know its name. The things I know are that it's the active workbook, and that the macro's name is "Update_Graph".

Here's the code I experimented with, which obviously doesn't work because of the quotes.

Application.Run _
"'" & File.Name & "'!Update_Graph"

Bob Phillips
07-11-2008, 01:19 PM
Application.Run _
"'" & ActiveWorkbook.Name & "'!Update_Graph"

realitybend
07-11-2008, 01:35 PM
This is also part of that. It tells me "object requred". I have a check box that is supposed to say whether it should save or not.

Workbooks(ActiveWorkbook.Name).Close SaveChanges:=CheckBox1.Value

mdmackillop
07-12-2008, 06:27 AM
You probably need a Sheet qualifier for the checkbox.