Macro terminates early without error message

R

Richard J. Snee

Macro terminates early without error message. This has occured several times
in code that was working literally for years. If I trace the execution in
Debug mode the macro just ends short. No errors. On error resume next has no
effect. On error goto 0 has no effect.
 
B

Barb Reinhardt

You're goiing to have to step through the code to determine where it's
failing. Put in a bunch of debug.prints to figure out where it might be.
When you find it, post that piece of code and someone should be able to help
you.
 
R

Richard J. Snee

With ActiveSheet.PageSetup
.PrintTitleRows = "$101:$105" 'macro ends here
.PrintTitleColumns = ""
End With
 
C

cht13er

With ActiveSheet.PageSetup
.PrintTitleRows = "$101:$105" 'macro ends here
.PrintTitleColumns = ""
End With

Those few lines all by themselves is no problem for me ... in Page
Setup afterwards it says "Rows to repeat at top:" $101:$105

Chris
 
B

Barb Reinhardt

What's the address of your print area? I didn't get the printtitlerows to
display if the print area was above the print titles. I'm wondering if
that's an issue with you.

Does it give an error of any kind?

Barb Reinhardt
 
B

Barb Reinhardt

Also, can you check to see if the activesheet.name is what you expect it to be?
 
R

Richard J. Snee

Activesheet is correct.
Added three line to see if I could get any error feedback...no luck nothing...
Print area is set to C106:AM137
Notice Titles rows property does get set but macro terminates.

I'm gressing that something in the environment is causing this. Maybe Live
Link or some othe software in Shell's system is putting some hidden "hooks"
into Excel. Some how these get triggered and the code "fails" in a hidden
module. I am hoping someone has seen this and has some idea what is going on.
The code that is failing is simple and has worked for years...does anyone
have any ideas?


Application.DisplayAlerts = True ' added to see if I can get an
error message
Application.ScreenUpdating = True ' added to see if I can get an
error message
On Error GoTo 0 ' added to see if I can get an
error message

ActiveSheet.PageSetup.PrintArea = "$C$106:$AM$" & BottomOfData '
Bottomofdata = 137
ActiveWindow.ScrollRow = 1
With ActiveSheet.PageSetup
.PrintTitleRows = "$101:$105" ' macro terminates here without
error message
.PrintTitleColumns = ""

End With
 

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