• 主页
  • VBS
  • .NET技术
  • VBA
  • VB网络编程
  • VB多媒体
  • VB数据库
  • VB控件
  • VB COM/DCOM
  • VB基础类
  • VB API
【求助】打开的excel总是没办法从资源管理器中彻底关闭

Public Sub data_mornitor()

Dim Open_Path As String
Open_Path = "c:\数据\"

Dim Catalogue As New System.IO.DirectoryInfo(Open_Path) '这里是你的文件夹路径
Dim Open_File As System.IO.FileInfo
Dim xx_number As Integer

Dim xlapp_1 As New Excel.Application
Dim xlbook_1 As Excel.Workbook
Dim xlsheet_1 As Excel.Worksheet
xlapp_1.Visible = False '显示excel 程序
' ListBox1.Items.Add(Open_File.Name) '将遍历的文件写到框里面

For Each Open_File In Catalogue.GetFiles '遍历整个文件夹

data_judge(Open_File.Name)

If data_judge_result = 0 Then
number_jieguo = number_jieguo + 1
Name_jieguo(number_jieguo, 1) = Open_File.Name '未监控过的结果,加入列表,开始判断

''读取文档内数据’’

xlbook_1 = xlapp_1.Workbooks.Open(Open_Path & Open_File.Name)
xlsheet_1 = xlbook_1.Worksheets(1)

Do Until xlsheet_1.Cells(xx_number + 1, 1).value = "Primary Current START (A): "
xx_number = xx_number + 1
Loop

' MsgBox(xlsheet_1.Cells(xx_number + 1, 3).value)
Name_jieguo(number_jieguo, 2) = "file_monitored"
xx_number = 1

Else

End If
Next
xlsheet_1 = Nothing
xlapp_1.Workbooks.Close()
xlapp_1.Quit() '关闭Excel
xlapp_1 = Nothing
' KillProcess()
MsgBox("完成一次"
End Sub
...全文
288 点赞 收藏 3
写回复
3 条回复

还没有回复,快来抢沙发~

发动态
发帖子
VB
创建于2007-09-28

1.1w+

社区成员

11.0w+

社区内容

VB技术相关讨论
社区公告
暂无公告