日期:2014-05-18 浏览次数:20764 次
'读取路径 Public readPath As String Public app As Excel.Application Public wbs As Excel.Workbooks Public wb As Excel.Workbook Public wss As Excel.Worksheets Public ws As Excel.Worksheet ''' <summary> ''' 打开一个Excel文件 ''' </summary> ''' <param name="FileName">文件名</param> ''' <remarks></remarks> Public Sub Open(ByVal FileName As String) Try app = New Excel.Application() wbs = app.Workbooks [color=#FF0000]wb = wbs.Open(readPath & FileName, Type.Missing, False, Type.Missing,Type.Missing, _Type.Missing, Type.Missing, Excel.XlPlatform.xlWindows, Type.Missing, Type.Missing, _Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing)[/color] Me.mFilename = FileName Catch ex As Exception End Try End Sub