monica1
10th November 2004, 12:34
I need to print a letter and then an excel file.
It's possible to do the 2 prints in a baan session?
I want to do something like:
brp = brp.open(my.report, spool.device, 1)
print.records()
brp.close(brp)
print document.xls
mark_h
10th November 2004, 16:11
Yes - you could do this. You could use app_start to execute excel. What I do not know is if you could do this all in one command. I can launch excel with a macro to print a report and then close, but that is the only way I know to do this.
Mark
monica1
10th November 2004, 17:31
Yes, but how can I do this macro? Is an excel macro?
mark_h
10th November 2004, 20:29
To learn about Excel macros just open up Excel and run help. Practise by recording macros and playing with the code. I do not know exactly what your requirements are, but below is a macro to open, print and close a spreadsheet.
Workbooks.Open Filename:="M:\Data\EXCEL\perfsummary.xls"
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
ActiveWindow.Close
If a put this in the auto_open() subroutine then every time I opened my macro spreadsheet it would then do this. So in effect I could launch excel with this macro spreadsheet - have it open a file, print and close a file. So by putting something like excel c:\testmacro in the app_start command I could achieve what you asked. Not perfect, but it would work.
Mark
monica1
11th November 2004, 09:42
Thank you very much, it works fine.