0

I would like to copy and paste special values in excel using VB6 during report generation. But pastespecial is not working. Its throwing error 1004 Paste Special method worksheet failed.

Below is the code. can you please advise

xlTmp.ActiveSheet.Range("H7:H23").Select
xlTmp.Selection.Copy
xlTmp.Sheets("Consolidation").Activate
xlTmp.ActiveSheet.Cells(6, 4).Value = P(N)
xlTmp.ActiveSheet.Cells(8, PS).Select
xlTmp.ActiveSheet.PasteSpecial xlPasteValues, xlNone, False, False
2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by AndreRet
0

I think the problem might be with the range not specified. Try the following -

xlTmp.Activesheet.Range("A1").PasteSpecial Paste:=xlValues, xlNone, False, False
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.