Breakpoint without breakpoint?

Jaymond Flurrie

Well-known Member
Joined
Sep 22, 2008
Messages
921
Office Version
  1. 365
Platform
  1. Windows
What can cause the code to break and display VBE window and painting a row to yellow other than an error or a breakpoint? Something throws my code to there and it doesn't display an error, neither the line is red (ie. has a breakpoint).
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
What's the line of code?
Do you have any watches set up on your code?

No watches set. I need to make sure what line it was, but I think it was the first of these:

Code:
shtCharts.PageSetup.PrintArea = Range("A1:A282").Address
strPrintPath = "c:\charts.pdf"
shtCharts.ExportAsFixedFormat xlTypePDF, strPrintPath

But for sure it had something to do with the PDF-printing. It acted like there was a breakpoint, but I'm 100% sure I had removed it.
 
Upvote 0
Have you rebooted? The VBE does that occasionally.
 
Upvote 0
When you're in the VBA code, bring up the watch window to make sure, and delete any watches that are there.

If you can post the line of code I'll try and see what's what.

@Rorya - have you any idea why?
 
Upvote 0
Not specifically. It usually follows an user interrupt of code (Ctrl+Break seems to be a common one) and then code will randomly stop on a line that has nothing wrong with it - clicking Continue usually works with no problems. Sometimes you can get round it with a reboot, other times you need to set Application.EnableCancelKey to xlDisabled at the start of the code and reset it afterwards.
 
Upvote 0
Not specifically. It usually follows an user interrupt of code (Ctrl+Break seems to be a common one) and then code will randomly stop on a line that has nothing wrong with it - clicking Continue usually works with no problems. Sometimes you can get round it with a reboot, other times you need to set Application.EnableCancelKey to xlDisabled at the start of the code and reset it afterwards.

Yeah, this sounds very close to what I had, sorry that I forgot to mention that continue works without any problems.

I'm pretty sure this one will solve the problem, I'll reply back again if I'm still having the issue.

Thanks to all of you!
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,672
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top