码迷,mamicode.com
首页 > 其他好文 > 详细

VSTO杂项拾零(持续更新中……)

时间:2017-06-03 12:36:12      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:vda   csv   sha   bsp   div   object   nload   ati   visual   

   环境:win 7+visual basic 2008     侧重:VSTO     界面:sheetbook工作簿

1.创建一个过程并调用(2017.6.3)

Public Class Sheet1
    Private Sub Fileprocessor(ByVal fileName As String)
        Dim fs As System.IO.FileStream = New System.IO.FileStream(fileName, System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.Read)
        fs.Close()
    End Sub

    Private Sub Sheet1_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
        Fileprocessor("c:\download\csvdata.txt")
    End Sub

    Private Sub Sheet1_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown

    End Sub


End Class

 2.读取TXT文件并显示在sheet1的单元格中(2017.6.3)

Public Class Sheet1

    Private Sub Sheet1_Startup1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
        Application.ScreenUpdating = False
        Application.Workbooks.Open("C:\download\csvdata.txt", Delimiter:="", Editable:=True, AddToMru:=True)
        Application.ScreenUpdating = True
    End Sub
    Private Sub sheet1_Shutdown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shutdown

    End Sub
End Class

 

VSTO杂项拾零(持续更新中……)

标签:vda   csv   sha   bsp   div   object   nload   ati   visual   

原文地址:http://www.cnblogs.com/xiehaofeng/p/6936706.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!