ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro terminates early without error message (https://www.excelbanter.com/excel-programming/409498-macro-terminates-early-without-error-message.html)

Richard J. Snee

Macro terminates early without error message
 
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.

Barb Reinhardt

Macro terminates early without error message
 
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.
--
HTH,
Barb Reinhardt



"Richard J. Snee" wrote:

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.


Richard J. Snee

Macro terminates early without error message
 
With ActiveSheet.PageSetup
.PrintTitleRows = "$101:$105" 'macro ends here
.PrintTitleColumns = ""
End With

"Richard J. Snee" wrote:

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.


cht13er

Macro terminates early without error message
 
On Apr 16, 7:08 pm, Richard J. Snee
wrote:
With ActiveSheet.PageSetup
.PrintTitleRows = "$101:$105" 'macro ends here
.PrintTitleColumns = ""
End With

"Richard J. Snee" wrote:
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.


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

Barb Reinhardt

Macro terminates early without error message
 
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



"cht13er" wrote:

On Apr 16, 7:08 pm, Richard J. Snee
wrote:
With ActiveSheet.PageSetup
.PrintTitleRows = "$101:$105" 'macro ends here
.PrintTitleColumns = ""
End With

"Richard J. Snee" wrote:
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.


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


Barb Reinhardt

Macro terminates early without error message
 
Also, can you check to see if the activesheet.name is what you expect it to be?
--
HTH,
Barb Reinhardt



"Richard J. Snee" wrote:

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

"Richard J. Snee" wrote:

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.


Richard J. Snee

Macro terminates early without error message
 
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





"Barb Reinhardt" wrote:

Also, can you check to see if the activesheet.name is what you expect it to be?
--
HTH,
Barb Reinhardt



"Richard J. Snee" wrote:

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

"Richard J. Snee" wrote:

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.



All times are GMT +1. The time now is 12:23 AM.

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