Please please please help... great trouble here..(Page Breaks Problem)

U

usiddiqui

Can any body help me immediately.

Please understand the snario.


I am setting the page breaks on my excel sheet. that i had generated b
executing code from Visual Basic. When i first time generate the exce
sheet the code used to set the page breaks executes right. but when
second time execute the code. the code to set the page breaks, Fails.

Below is given the code that i am using to set the page breaks.

Plese help ..


wrkSheet.HPageBreaks.Add Before:=Cells(Row, 1)
wrkSheet.VPageBreaks.Add Before:=Cells(1, CmbMaxColumns+1)


Follwing is the error that s show when i execute the code secon
time... Please Please help. I am just stuck... I have to send th
shipment of the software project tonight...

Error : '462'
The Remote server machine does not exist or is un available


This is to note that i am not using any network resource. its strang
for me..why i am getting this erro
 
F

Frank Kabel

Hi
first: posting this just some minutes after your first post won't help
you.

To get a more specific answer you may post some more parts of your
current macro (maybe if the macro is not that long the complete
procedure)

For me this sounds like you lost the object reference or have something
undefined in your code
 
A

AlfD

Hi!

Sorry to hear of your problem.

I don't know the answer. But a question or two?

Have you tried clearing page breaks after use?

Would you be better to use pagebreak rather than the vpagebreaks an
hpagebreaks collections?

Just to provoke thought.

Al
 
A

AlfD

Hi!

The best help I can offer is from Excel VB Help.

PageBreak Property Example

This example sets a manual page break above row 25 on Sheet1.

Worksheets("Sheet1").Rows(25).PageBreak = xlPageBreakManual
This example sets a manual page break to the left of column J o
Sheet1.

Worksheets("Sheet1").Columns("J").PageBreak = xlPageBreakManual
This example deletes the two page breaks that were set in the precedin
examples.

Worksheets("Sheet1").Rows(25).PageBreak = xlPageBreakNone
Worksheets("Sheet1").Columns("J").PageBreak = xlNone

Al
 

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