View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.setup
Bob Phillips
 
Posts: n/a
Default Help:Running a macro in one excel workbook from another workbook

A simple test for me worked fine. Is there anything in the NextDay macro
that might be causing it to fail?

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"R Kapoor" wrote in message
...
I am trying to execute the following given macro from the current

workbook.
The macro opens the workbook "2148.xls" and waits there. It does not

proceed
to run the macro "NextDay" as given in line number 3.

However, if I execute the entire macro step by step from Visual Basic

(using
F8) it works fine. What could be the problem? What is the solution.



Workbooks.Open Filename:="C:\Data\GLIF\2148.xls"
Windows("2148.xls").Activate
Application.Run "2148.xls!NextDay"
Sheets("2148").Select
ActiveSheet.PageSetup.PrintArea = "$A$1:$I$51"
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True
Sheets("Summary").Select
ActiveWindow.SelectedSheets.PrintOut Copies:=2, Collate:=True
ActiveWorkbook.Save
ActiveWorkbook.Close