Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing reports from Report Manager

3 views
Skip to first unread message

Bronson C. Elliott

unread,
Sep 16, 1999, 3:00:00 AM9/16/99
to
I have a file that uses the Report Manager add-in in Excel 97. I've written
some code that prints 1 of 3 reports based on a flag cell. Anyway, I didn't
know how to call the Report Manager reports so I used the macro recorder and
it created the following code:

Application.ExecuteExcel4Macro String:="
REPORT.PRINT(""[ReportName]"",1)"

My question is this - is there a more direct way to call these reports than
the above code??? The code works fine, I'm just trying to see if there is a
better or "cleaner" way to call these reports.

Thanks a lot!!!

Bronson C. Elliott

Venkata Krishna

unread,
Sep 17, 1999, 3:00:00 AM9/17/99
to
Bronson
 
The statement -
 
Application.ExecuteExcel4Macro String:=" REPORT.PRINT(""[ReportName]"",1)"
 
actually means that - Call the macro "Print" in Module "Report" of "Reports.xla" by passing the arguments "ReportName" and 1(here, 1 corresponds to number of copies) .Using this syntax you can also call your macros.
Excel97 equivalent is :
 
Application.Run "REPORTS.XLA!Report.Print", "ReportName", 1
 
Note that in either case, Reports.xla must be open at the time of execution of the statement. Reports.xla is automatically opened if any print is made from View | Reportmanager for the first time. Else, you need to specifically open it and run it's auto macros before these statements can work. Or, you can directly specify the path name of Reports.xla so that you need not specifically open it:
 
Application.Run "'D:\Program Files\Microsoft Office\Office\Library\REPORTS.XLA'!Report.Print", "ReportName", 1
 
Application.ExecuteExcel4Macro String:="'D:\Program Files\Microsoft Office\Office\Library\REPORTS.XLA'!REPORT.PRINT(""ReportName"",1)"
 
Regards
Venkata Krishna
 
Bronson C. Elliott <bron...@mindspring.com> wrote in message news:OJZMviLA$GA.196@cppssbbsa03...
0 new messages