代码,将PictureBox中的图片保存并插入Excel: Option ExplicitDim xApp As New Excel.Application Dim xDoc As Excel.WorksheetDim oXL As Excel.Application Dim oWB As Excel.Workbook Dim oWS As Excel.Worksheet Dim oSC As Excel.Range Dim oDC As Excel.RangePrivate Sub Command1_Click() SavePicture Picture1.Image, "c:\aaa.bmp"
Option ExplicitDim xApp As New Excel.Application
Dim xDoc As Excel.WorksheetDim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oWS As Excel.Worksheet
Dim oSC As Excel.Range
Dim oDC As Excel.RangePrivate Sub Command1_Click()
SavePicture Picture1.Image, "c:\aaa.bmp"
Set oXL = CreateObject("Excel.Application")
Set oWB = oXL.Workbooks.Add
Set oWS = oWB.Worksheets(1)
oWS.Pictures.Insert "c:\aaa.bmp"
oWS.SaveAs "c:\d.xls"
Set oWS = Nothing
oWB.Save
oWB.Close False
Set oWB = Nothing
oXL.Quit
Set oXL = Nothing
End Sub