只显示打印预览窗口,不显示EXCEL
调用方式:
foxls.mExcel.openxls("D:/abc.xls")
源代码
Imports Microsoft.Office.Interop
Public Module mExcel
Sub openxls(ByVal FilePath As String)
If IO.File.Exists(FilePath) Then
Dim app As New Excel.Application
Dim book As Excel.Workbook = app.Workbooks.Open(FilePath)
Dim sheet As Excel.Worksheet = book.Sheets.Item(1)
app.Visible = True
sheet.PrintPreview()
book.Close()
app.Quit()
Else
MsgBox("文件不存在!", MsgBoxStyle.OkOnly)
End If
End Sub
End Module
[此贴子已经被作者于2009-11-27 19:55:37编辑过]