在Kotlin中上课时遇到的问题

时间:2018-12-30 13:58:08

标签: class kotlin

newS8OOPSimpleClass.kt enter image description here enter image description here

运行此命令时,我会被错误提示“重新声明”。

1 个答案:

答案 0 :(得分:1)

根据屏幕截图,您已经在2个单独的文件中声明了For Each wbFile In folder.Files If fso.GetExtensionName(wbFile.Name) = "xlsx" Then Set wb = Workbooks.Open(wbFile.Path) For Each ws In wb.Sheets ThisWorkbook.Sheets(1).Range(Cells(y, 1)).Value = ws.Range("E19").Value ThisWorkbook.Sheets(1).Range(Cells(y, 2)).Value = ws.Range("E35").Value y = y + 1 Next ws wb.Close End If Next wbFile 类: CarnewS8OOPSimpleClass.kt。您无法在Kotlin中做到这一点。您必须删除其中之一-可能不需要newS8Constructor.kt中的一个。