这是我以前用过的一段!
Private Sub showtable() '显示工资条的
'On Error Resume Next
Dim Irow, Icol As Integer
Dim Irowcount, Icolcount As Integer
Dim strSource, strDestination As String
strSource = App.path & "\RegisterFee.xlt"
'‘RegisterFee.xls就是一个模版文件
strDestination = App.path & "\Temp.xls"
FileCopy strSource, strDestination
'‘将模版文件拷贝到一个临时文件
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
' xlApp.Visible = False ‘隐藏EXCEL应用程序窗口
Set xlBook = xlApp.Workbooks.Open(strDestination)
'‘打开工作簿,strDestination为一个EXCEL报表文件
' Set xlBook = xlApp.Workbooks.Add(App.Path & "\book1.xlt")
Set xlSheet = xlBook.Worksheets(1)
Dim Fieldlen1 As Integer