Error Message: "Can't Execute Code in Break Mode"

C

cru

Hi Everyone,

Does anyone know why I would get this error message?

Here's the code:
Sub Comp_Button()

Sheets("Input Form").Unprotect "password"
Range("D12,D13,D14,D15,D17,D22,D24,D26,D29,D30,D31,D32,G32,A55,A57,A59").Select
Selection.CheckSpelling

Range("Y29:BG29").Select
Selection.Copy
Sheets("REFUND SPREADSHEET").Activate
'Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
 
D

Don Guillett

Perhaps you meant to select the Input Form sheet?. However, selections
aren't necessary or desirable

Sub checkspelling()'Notice the DOTS on the indented lines
With Sheets("Input Form")
.Unprotect "password"
.Range("D12,D13,D14,D15,D17,D22,D24,D26,D29,D30,D31,D32,G32,A55,A57,A59").checkspelling
.Range("Y29:BG29").Copy
Sheets("REFUND SPREADSHEET").Range("A4").PasteSpecial Paste:=xlPasteValues
.protect "password"
End With
End Sub

Sub Comp_Button()

Sheets("Input Form").Unprotect "password"
Range("D12,D13,D14,D15,D17,D22,D24,D26,D29,D30,D31,D32,G32,A55,A57,A59").Select
Selection.CheckSpelling

Range("Y29:BG29").Select
Selection.Copy
Sheets("REFUND SPREADSHEET").Activate
'Range("A4").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
End Sub
 
C

cru

Don,

Thank you for information.

Can I just insert the first three lines into the Comp_Button? (I'm sorry
for the stupid question).

I wanted to run the spell checking upon pressing_comp button and then
copy/paste the information on Y29:BG29 into Refund Spreadsheet.

thanks.
 
J

JLGWhiz

I was thinking the spell check might be the culprit, but I could not get it
to duplicate the error so maybe Don's code will clear it up.
 

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

Similar Threads


Top