首先要引用EXCELL类( Microsoft Excel 11.0 Object Library)
dim XX as string '这个是你计算出的结果,我以字符类型为例
Dim xltmp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlsheet As Excel.Worksheet
Set xltmp = New Excel.Application
xltmp.Visible = False
Set xlBook = xltmp.Workbooks.Add
Set xlsheet = xlBook.Worksheets(1)
xlBook.Worksheets(1).Cells(5,3) =xx
xlBook.Close True
Set xlsheet = Nothing
Set xlBook = Nothing
xltmp.Quit
Set xltmp = Nothing
温馨提示:内容为网友见解,仅供参考