I've got a bit of a macro that opens a second workbook, copies its contents, pastes it into the workbook from which the macro was run, then closes the workbook that was opened.
Sheets("Temp").Select
Cells.Select
Selection.ClearContents
Workbooks.Open Filename:="sourceofcopy.xlsx"
Cells.Select
Selection.Copy
Windows("alreadyopen.xlsm").Activate
Range("A1").Select
ActiveSheet.Paste
**Windows("sourceofcopy.xlsx").Activate
ActiveWorkbook.Application.CutCopyMode = False
ActiveWindow.Close
This all runs fine on my own PC, but at the starred activation line it errors out for others on our LAN. Any inclination as to why that may be, or alternatively would there be a good way to perform this copy without opening or activating the sourceofcopy.xlsx workbook? The aim is simply to copy the entire contents of a single worksheet to the open workbook for analysis. VBA is definitely not my line of work, so please have patience with the newb!
Bookmarks