application.windows object
Hello,
There are 2 separate Excel application windows. First one contains "Excel1.xlsx" and "Excel2.xlsx" and the second application window contains "Excel3.xlsm" and "Excel4.xlsx". In the VBA code of "Excel3.xlsm" - How do I copy "Excel1.xlsx".Sheet1.Range("A1") to "Excel3.xlsm".Sheet1.Range("A1")?
My only way to open "Excel1.xlsx" for read only in the same, second application window for the copy process. Is there a simple solution?
Code:
Sub Collects()
If Workbooks("Excel1.xlsx") Is Nothing Then Workbooks.Open Filename:="Excel1.xlsx"
Application.Workbooks("Excel3.xlsm").Worksheets("Sheet1").Activate
Range("A1")=Workbooks("Excel1.xlsx").Worksheets("Sheet1").Range("A1")
End Sub