【发布时间】:2018-12-02 05:38:14
【问题描述】:
让我知道我的代码的错误在哪里:
Dim oExcel As Object
Dim oBook As Object
Dim oSheet As Object
**Set oBook = oExcel.Application.Workbooks.Open(App.Path & "\Data" & "\" & Label4.Caption & "" & "\" & Label4.Caption & ".xls")**
'opens the filename workbook but this is where the ERROR pointing me at.
Set oSheet = oExcel.Application.ActiveSheet 'activate the first worksheet
oSheet.Range("A1").Value = Label1.Caption
oSheet.Range("B1").Value = Label2.Caption
oExcel.Save
oExcel.Quit
【问题讨论】: