Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA error when running a macro from another form

Status
Not open for further replies.

vikingatc

Technical User
Jul 5, 2006
8
US
I am trying to run a macro located in Workbook B from some VBA in Workbook A within Excel 2007

I've tested this code in some test workbooks and it works great. However, when I try this from the actual workbooks, it does not work. I get an error:Cannot run the macro 'name of macro' The macro may not be available in this workbook or all macros may be disabled.

Thing is: it should be available and macros are not disabled. When I replace the reference to Workbook B with one to Workbook C, it works fine. Is there something, a setting somewhere, that I am missing?

Any help would be appreciated. I would post the code, but the code works - or at least it does elsewhere.

I'm all sorts of lost!

Thanks!
Ben
 
I have not used 2007 nor have I ever tried running a macro in book B from code in book A. So I am basically wasting both our time right now but it is an interesting post.

What I don't understand is how changing the reference from book B to C has anything to do with it. Is one already open and the other closed? What is different between B and C?

I'm sure you've been down this road already but it's all I can think of right now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top