Hi
I want to be able to copy 3 cells of one row in one Excel file, and paste them into 3 cells of one column in another Excel file. I am using the Transpose property of the PasteSpecial command as part of the Excel module, but am getting errors whenever I set the 'Transpose' property to 'True'. I am not 100% sure how correct my code is as I wasn't sure how to tell it to transpose the selection. I looked on the web and the most common answer to questions about transposing cells simply to add 'false, true' inside the paste special brackets (false for skipblanks, true for transpose).
Here is my code:
CODE
xlSht = xlApp.Worksheets("Paddock")
xlRng = xlSht.Range(xlSht.Cells(2, 2), xlSht.Cells(2, 5))
xlOutRng = xlOutSht.Cells(3, 4)
xlRng.Copy()
xlOutRng.PasteSpecial(Microsoft.Office.Interop.Excel.XlPasteType.xlPasteAll, Microsoft.Office.Interop.Excel.XlPasteSpecialOperation.xlPasteSpecialOperationNone, False, True)
Note: I get the error "PasteSpecial method of Range class failed" on the last line.