Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying and Pasting cells within an Add-In
Hello
I am putting together an Excel Add-In for a client. One function of the add-in needs to perform is to give the client the capability to save values entered as default. So I have a sheet within the add-in to store the values entered. The Userform uses the Spreadsheet control from the Microsoft Office Web Components. The following line of code works, which copies a range of cells in the control to the clipboard: xlsExpectedStarts.ActiveSheet.Range(xlsExpectedSta rts.ActiveSheet.ViewableRange).Copy I am getting the following error when I try and paste the contents to the worksheet to store the defaults. Run-time error '-2147024809 (80070057)': Invalid Argument. I have tried to specify the range to copy to within the copy statement as follows: ThisWorkbook.Sheets("shtT1_Default").Range("rngEST _T1") I have also tried to paste the cells after the copy statement as follows: shtPaste = ThisWorkbook.Sheets("shtT1_Default").Range("rngEST _T1").Select shtPaste.Paste I get the same error message. I have used the copy statement by itself and the used Ctrl-V to paste the cells into a new sheet. So it works, but I have not found the right way to specifiy it in code. Any help would greatly be appreciated. Thanks in advance Tom Meschede |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pasting Cells in Excel - Not copying all content | Excel Discussion (Misc queries) | |||
Copying cell contents from many cells and pasting into one cell | Excel Discussion (Misc queries) | |||
Copying and pasting to visible cells only | Excel Discussion (Misc queries) | |||
keeping cells locked and protected when copying and pasting | Excel Discussion (Misc queries) | |||
copying and pasting not adjecent cells | Excel Programming |