Home > Net >  [for] open the excel is always can't completely shut down from the resource manager
[for] open the excel is always can't completely shut down from the resource manager

Time:05-07


Public Sub data_mornitor ()

Dim Open_Path As String
Open_Path="c: \ data "

Dim Catalogue As the New System. IO. DirectoryInfo (Open_Path) 'here's your folder path
Dim Open_File the As System. IO. The FileInfo
Dim xx_number As Integer

Dim xlapp_1 As New Excel. Application
Dim xlbook_1 As Excel. The Workbook
Dim xlsheet_1 As Excel. The Worksheet
Xlapp_1. Visible=False 'show excel program
'ListBox1. Items. The Add (Open_File. Name)' will traverse the file writes box

For Each Open_File In Catalogue. GetFiles traverse the entire folder
'
Data_judge (Open_File. Name)

If data_judge_result=0 Then
Number_jieguo=number_jieguo + 1
Name_jieguo (number_jieguo, 1)=Open_File. The Name 'not monitoring results, to join the list, began to judge

"' read documents data within"

Xlbook_1=xlapp_1. Workbooks. Open (Open_Path & amp; Open_File. Name)
Xlsheet_1=xlbook_1. Worksheets (1)

Do Until xlsheet_1. Cells (xx_number + 1, 1). The value="https://bbs.csdn.net/topics/Primary Current START (A) :"
Xx_number=xx_number + 1
Loop

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

The Else

End the If
Next
Xlsheet_1=Nothing
Xlapp_1. Workbooks. The Close ()
Xlapp_1. Quit () 'close Excel
Xlapp_1=Nothing
'KillProcess ()
MsgBox (" complete a "
End Sub
  • Related