首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

如何用excel.application.workbooks.open读取EXCEL模板

2012-04-04 
怎么用excel.application.workbooks.open读取EXCEL模板VB.NET code读取路径Public readPath As StringPub

怎么用excel.application.workbooks.open读取EXCEL模板

VB.NET code
    '读取路径    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

读一个模板,在红色那一段,就会卡住,等N长时间也不往下走,也不出错,求教我这样写对吗?

[解决办法]
http://blog.csdn.net/fangxinggood/article/details/655313

热点排行