|
谢谢分享!
转接后下面代码出错:
Private Sub Command11_Click()
On Error GoTo Err_Command11_Click
Me.frm报废单查询1.SetFocus '把焦点移动子窗体上,要操作的子窗体的名称
DoCmd.GoToRecord , , acFirst
DoCmd.RunCommand acCmdSelectAllRecords
DoCmd.RunCommand acCmdCopy
Dim obj As Object
Set obj = CreateObject("excel.application")
obj.Workbooks.Add
obj.Visible = True
SendKeys "^v"
On Error Resume Next
oApp.UserControl = True
Exit_Command11_Click:
Exit Sub
Err_Command11_Click:
MsgBox Err.Description
Resume Exit_Command11_Click
End Sub
后将oApp改为obj成功!不知是否有问题! |
|