ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Page Breaks Problem ( Please Help) (https://www.excelbanter.com/excel-programming/298932-page-breaks-problem-please-help.html)

usiddiqui[_3_]

Page Breaks Problem ( Please Help)
 
Hello All.


I am having problem in setting the page breaks. I am only encounterin
the problem when i execute the code the second time. Please try t
understarnd my problem.

- I am generating the excel sheets from text files
- When i complete generating the text file in to the excel sheet.
- I set the page breaks for tha perticular excel sheet.
- When i do it the first time all the things goes fine
- But when i repeat the process or when i convert the second exce
sheet. the process go failed.


This is the line of code that i am executing..... Please Help ...


wrkSheet.HPageBreaks.Add Befo=Cells(Row, 1)wrkSheet.VPageBreaks.Ad
Befo=Cells(1, CmbMaxColumns+1

--
Message posted from http://www.ExcelForum.com


Frank Kabel

Page Breaks Problem ( Please Help)
 
Hi
add the following line before you insert your pagebreaks (clears all
existing pagebreaks):
wrkSheet.ResetAllPageBreaks

--
Regards
Frank Kabel
Frankfurt, Germany


Hello All.


I am having problem in setting the page breaks. I am only

encountering
the problem when i execute the code the second time. Please try to
understarnd my problem.

- I am generating the excel sheets from text files
- When i complete generating the text file in to the excel sheet.
- I set the page breaks for tha perticular excel sheet.
- When i do it the first time all the things goes fine
- But when i repeat the process or when i convert the second excel
sheet. the process go failed.


This is the line of code that i am executing..... Please Help ...


wrkSheet.HPageBreaks.Add Befo=Cells(Row,

1)wrkSheet.VPageBreaks.Add
Befo=Cells(1, CmbMaxColumns+1)


---
Message posted from http://www.ExcelForum.com/




All times are GMT +1. The time now is 09:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com