Sub openwb()
Dim x260path As String
x260path = "E:\sarath\PTMetrics\20131002\D8 L538-L550 16MY\D8 L538-L550_16MY_Powertrain Metrics_" & Format(Date, "YYYYMMDD") - 1
Workbooks("x260path").Activate
ActiveWorkbook.SaveAs ["E:\sarath\PTMetrics\20131002\D8 L538-L550 16MY\D8 L538-L550_16MY_Powertrain Metrics_" & Format(Date, "YYYYMMDD")]
Debug.Print x260path
End Sub
在这里,当我执行时,错误提示“下标超出范围”。它出现在第 4 行。当我使用“工作簿”来声明“x260path”而不是字符串时,它在第 3 行显示另一个错误说“对象变量或未设置块变量”。你能帮忙吗?为什么会这样?