
import os
path='C:/Users/EDZ/Desktop/工作/2021.08.19/'
for infile in glob.glob(os.path.join(path, '*.csv')):
print(infile)
import os
import glob
path='C:/Users/EDZ/Desktop/工作/2021.08.19/'
for infile in glob.glob(os.path.join(path, '*.csv')):
os.remove(infile)
print(infile)
您好,很高兴能帮助您Private Sub Command1_Click()
Dim FileName As String, FilePath As String
Dim iFolder As Object, Xlapp As Object, Sh As Object
Set iFolder = CreateObject("shell.application").BrowseForFolder(0, "", 0, "")
If iFolder Is Nothing Then Exit Sub
FilePath = iFolder.Items.Item.Path
FilePath = IIf(Right(FilePath, 1) = "\", FilePath, FilePath &"\")
FileName = Dir(FilePath &"*.xls*")
Set Xlapp = CreateObject("excel.application")
Xlapp.displayalerts = False
Do Until Len(FileName) = 0
With Xlapp.workbooks.open(FilePath &FileName)
For Each Sh In .WORKSHEETS
If Len(Sh.RANGE("B2").Value) = 0 Then Sh.Delete
Next
.Close True
End With
FileName = Dir
Loop
Xlapp.quit
Set Xlapp = Nothing
End Sub
你的采纳是我前进的动力,
记得好评和采纳,答题不易,互相帮助,
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)