View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Myrna Larson Myrna Larson is offline
external usenet poster
 
Posts: 863
Default Running a sub in a different workbook from a sub in this workbook?

Just a comment on the part quoted below. That macro isn't written correctly,
then. It shouldn't refer to ActiveCell or Selection. If you need to work with
cell A40 specifically, the code should say, for example,

Range("A40").Offset(1,0)

not

ActiveCell.Offset(1,0)

If you can't correct that, then your code must open FRED_ORDER.xls, activate
the Order sheet and select cell A40. Only after doing that can you call the
macro in that workbook.

As for the command to run it, look at the Application.Run statement in Help.
It will show you the syntax.

On Fri, 29 Oct 2004 02:36:51 -0400, R wrote:

ONE EXTRA IMPORTANT NOTE****:
The Macro FRED_ORDER.xls!order.order is completely dependant upon the
cursur being on cell A40 on the ORDER sheet in the FRED workbook. If
the active cell is not A40 on this sheet/workbook then this Macro
won't work (since it needs to "read" the A40 data to determine the
next action.