Hi All,
I have the code below, copy range G1:L60 from "Sheet1" of a closed workbook named "A.xlsx" to my current active workbook/ activesheet
Issue is when i run macro there was no error but nothing got copied over.
I have the code below, copy range G1:L60 from "Sheet1" of a closed workbook named "A.xlsx" to my current active workbook/ activesheet
Issue is when i run macro there was no error but nothing got copied over.
VBA Code:
Option Explicit
Sub ImportData()
Dim App As New Excel.Application
Dim wsActive As Worksheet
Set wsActive = ThisWorkbook.ActiveSheet
Dim wbImport As Workbook
Set wbImport = App.Workbooks.Open(Filename:="G:\A.xlsx", UpdateLinks:=True, ReadOnly:=True)
wbImport.Worksheets("Sheet1").Range("G1:L60").Copy
wsActive.Range("G1").PasteSpecial Paste:=xlPasteAll
App.CutCopyMode = False
wbImport.Close SaveChanges:=False
App.Quit 'quit the hidden Excel
End Sub