WallisAggie646777
New Member
- Joined
- May 6, 2020
- Messages
- 8
- Office Version
- 365
- Platform
- Windows
The following 6 lines of code are contained in a worksheet Command button in the "Weekly" worksheet
When I click on the command button, the cannot paste error occurs.
With Sheets("Groups")
.Range(wsGroups.Cells(MonR, GroupC), wsGroups.Cells(GroupFriR + 4, GroupEndC)).Copy '
End With
wsWeekly.Activate ' "Weekly" worksheet
Range("A40").Select
ActiveSheet.Pictures.Paste(Link:=True).Select :The cannot paste error occurs on this line of code.
I can set a breakpoint on the line of code causing the error and then click on the Command button.
Execution stops on the line where the error occurred. I then use F8 to Step into to execute the line of code and it works by pasting the data as expected
In summary, with no breakpoint, the code fails when clicking on the Command button, but with the breakpoint, I can click on the Command button and then use F8 to step into the line of code and the code pastes the data as expected.
When I click on the command button, the cannot paste error occurs.
With Sheets("Groups")
.Range(wsGroups.Cells(MonR, GroupC), wsGroups.Cells(GroupFriR + 4, GroupEndC)).Copy '
End With
wsWeekly.Activate ' "Weekly" worksheet
Range("A40").Select
ActiveSheet.Pictures.Paste(Link:=True).Select :The cannot paste error occurs on this line of code.
I can set a breakpoint on the line of code causing the error and then click on the Command button.
Execution stops on the line where the error occurred. I then use F8 to Step into to execute the line of code and it works by pasting the data as expected
In summary, with no breakpoint, the code fails when clicking on the Command button, but with the breakpoint, I can click on the Command button and then use F8 to step into the line of code and the code pastes the data as expected.