Deleting excel Horizontal Page Breaks in VB.NET

K

Kalyani

I have a problem in deleting a horizontal pagebreak.
shows an exception : Exception from HRESULT: 0x800A03EC
With excelDRApp.ActiveWindow.ActiveSheet
Dim hxlpgbrk As Microsoft.Office.Interop.Excel.HPageBreak
For Each hxlpgbrk In .HpageBreaks
hxlpgbrk.Delete()
Next
end with

I want to delete this page break at a specific and insert one in a another
location.
Im able toa dd but not delete. So i tried the above codew hich deletes all
the page breaks.

Thanks in advance for any help.

Regards
Kalyani J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top