当我试图创建一个工作表对象时,出现错误:
Dim oFS : Set oFS = CreateObject("Scripting.FileSystemObject")
Dim oXls : Set oXls = CreateObject("Excel.Application")
Dim oWb : Set oWb = oXls.Workbooks.Open(oFs.GetAbsolutePathName("Wing_To_Wing_Report.xlsx"))
Dim aData ': aData = oWb.Worksheets(1).Range("$A2:$C10")
Dim dicP : Set dicP = CreateObject("Scripting.Dictionary")
Dim Range,ObSheet1,ObSheet2
Dim TotalRows,LastCol
ObSheet1=oWb.ActiveWorkbook.Worksheets("WingToWingMay25")
ObSheet2=oWb.ActiveWorkbook.Worksheets("ParentChildLink")
也试过这个:
ObSheet1=oWb.Worksheets("WingToWingMay25")
ObSheet2=oWb.Worksheets("ParentChildLink")
错误对象不支持此属性或方法:“ActiveWorkbook”
你能帮我吗?为什么这样。