如果你说的嵌入excel表格指的是ole对象的话,可以试一下这样
Sub test()
Dim ent As ZcadEntity
Dim basePt As Variant
ThisDrawing.Utility.GetEntity ent, basePt, "Pick a ole object:"
If ent.ObjectName = "AcDbOle2Frame" Then
If ent.OleSourceApp = "Microsoft Excel Worksheet" Then
ThisDrawing.SendCommand "_Select" & vbCr & "(handent " & Chr(34) & ent.Handle & Chr(34) & ")" & vbCr & vbCr
ThisDrawing.SendCommand "_OleOpen" & vbCr
Else
MsgBox "Not an Excel ole object"
GoTo err
End If
Else
MsgBox "Not an ole object"
GoTo err
End If
Dim myxls As Object
Dim myBook As Object
On Error Resume Next
Set myxls = GetObject(, "Excel.Application")
If err <> 0 Then
MsgBox "Could not get Excel application."
GoTo err
End If
Set myBook = myxls.ActiveWorkbook
myBook.SaveAs "C:\Users\Administrator\Desktop\test.xlsx"
myxls.Quit
err:
End Sub
方法可行👍