Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


Printing Workbooks from Excel

Keywords: 	 Printing Workbooks from Excel

; Code to print a WorkBook and all of its Sheets.

objExcel=ObjectOpen("Excel.Application")
objExcel.DisplayAlerts = @FALSE
objExcel.ScreenUpdating = @FALSE
objExcel.AskToUpdateLinks = @FALSE
objWB=objExcel.Workbooks
objWB.Open("C:\Documents and Settings\dwestmoreland\Desktop\Print\1996_BPR.XLS")

;objExcel.Visible = @TRUE
objsheets = objExcel.Worksheets
cnt = objsheets.count

For i = 1 to cnt
 thissheet=ObjExcel.WorkSheets(cnt)
 thissheet.Printout()
Next

objWorkbookActive = objExcel.ActiveWorkbook
objWorkbookActive.Close(::SaveChanges=@False)
objExcel.Quit
ObjectClose(objExcel)
Message("All","Done")