I'm having a problem with VB PasteSpecial.
This code works perfectly in Excel VB (given that you have selected cells with data)
Selection.Copy
Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Application.CutCopyMode = False
However, I'm using a third-party software (QlikView) that I extract the data from, which is then supposed to be copied into the Excel document. There is no problem with the normal paste but it MUST be transposed.
Obviously, since I dont have any content in the workbook to copy, I don't use
Selection.Copy
But because I don't copy anything from the document first (even though there are table data in the copy memory), this call returns bad argument exception (this also happens if I copy cells in that VERY workbook first and then just call the macro for transposing it).
Runtime error '1004' returned. PasteSpecial method of Range class failed.
Yes, I can paste it into the document, then cut it from the area, move it to the correct place and transpose it, but that is bad coding.
Have any of you experienced this and got a way to get this working ?