WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Excel
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Inserting Pagebreaks into Excel Sheet


Here is the code to insert a pagebreak into an Excel worksheet.
objXL = ObjectCreate("Excel.application")
objXL.Visible = @TRUE
objWorkbooks=objXL.WorkBooks
objWorkbooks.Open("C:\Temp\Data files\test.xls")

selection = objXL.Cells(Row,Col).select
myActiveCell = objXL.Activecell
objXL.ActiveWindow.SelectedSheets.HPageBreaks.Add (:: Before=myActiveCell)

objWorkbooks = 0
selection = 0
myActiveCell = 0
objXL = 0

Article ID:   W17158
File Created: 2007:07:03:14:28:32
Last Updated: 2007:07:03:14:28:32