ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copying and Pasting. (https://www.excelbanter.com/excel-programming/318220-copying-pasting.html)

Jared

Copying and Pasting.
 
I have to instances of excel. I want to copy from one instance of Excel and
Paste to another. I'm attempted the following code, which has worked fine
when working with one instances of excel. However, I get "object doesn't
support property or method " when trying it here.

Excel1.ThisWorkbook.Sheets(1).Cells(1, 1).Copy _
Excel2.ActiveWorkbook.ActiveSheet.Cells(1, 1)


Stephen Knapp

Copying and Pasting.
 
Even though you're running two instances of Excel, the operating system
considers them two, unique Microsoft Office applications. It's as though you
were trying to connect Word with Excel. You'll have to check all of the
software linkages (object definitions, assignments, etc) so that Excel_1 can
identify and then talk to Excel_2. Your code example, as written, is the
right idea but you should think of that as a macro-statement. Now, you have
to put together the details.

Steve in Ohio

"Jared" wrote:

I have to instances of excel. I want to copy from one instance of Excel and
Paste to another. I'm attempted the following code, which has worked fine
when working with one instances of excel. However, I get "object doesn't
support property or method " when trying it here.

Excel1.ThisWorkbook.Sheets(1).Cells(1, 1).Copy _
Excel2.ActiveWorkbook.ActiveSheet.Cells(1, 1)



All times are GMT +1. The time now is 07:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com