Page Breaks Problem ( Please Help)

  • Thread starter Thread starter usiddiqui
  • Start date Start date
U

usiddiqui

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 Before:=Cells(Row, 1)wrkSheet.VPageBreaks.Ad
Before:=Cells(1, CmbMaxColumns+1
 
Hi
add the following line before you insert your pagebreaks (clears all
existing pagebreaks):
wrkSheet.ResetAllPageBreaks
 

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

Back
Top