我正在尝试打开一个存储在桌面上固定位置的文件,并将某个工作表复制到当前工作簿中。
我收到错误438。
Sub RangeCheckFormula()
Dim TargetFile As Workbook
Dim TargetSheet As Worksheet
Set TargetFile = ActiveWorkbook
ActiveSheet.Range("F1") = "#"
ActiveSheet.Range("G1") = "CLUSTER"
ActiveSheet.Range("H1") = "PROFILE"
Sheets.Add
ActiveSheet.Name = "Outlet List"
Set TargetSheet = ActiveSheet
Application.Workbooks.Open (Environ("USERPROFILE") & "\Desktop\REQUIRED
FILES\" & "UPDATED_OUTLET_LIST")
CurrentSheet.Copy Before:=TargetFile.TargetSheet.Range("A1")
Workbooks("UPDATED_OUTLET_LIST.xlsx").Close SaveChanges:=False
End Sub
答案 0 :(得分:0)
您需要的只是
FineMaster