|
本帖最后由 清风香客 于 2014-12-24 15:25 编辑
文件管理.rar
(113.15 KB, 下载次数: 68)
贵表修改成
楼主,能不能把系统修改成这个式样?,我试着修改VBA,但没效果。
.Cells(I, J).Font.Bold = True
If J = 1 Then
.Cells(I, J).Interior.ColorIndex = J + 3
Else
.Cells(I, J).Interior.ColorIndex = 33
End If
.Range(Cells(I, J), Cells(I, 10)).Merge
.Range(Cells(I, J), Cells(I, 10)).Select
ActiveSheet.Hyperlinks.add Anchor:=Selection, Address:=spath, _
TextToDisplay:=myfs
.Cells(I, J).Font.Color = vbBlack
Call 设置边框(I, J, 10)
I = I + 1
sFileName = Dir(spath, 0)
Do While Len(sFileName) > 0
.Cells(I, 11).Select
ActiveSheet.Hyperlinks.add Anchor:=Selection, Address:=spath & sFileName, _
TextToDisplay:=sFileName
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''本段为我新增的,企图能达到我的效果
Set f = fs.GetFile(spath & sFileName) '返回指定路径文件所对应的 File 对象
Application.ScreenUpdating = False
On Error Resume Next
Application.DisplayAlerts = False
With GetObject(spath & sFileName)
Set wb = GetObject(spath & sFileName)
Set SH = wb.Sheets(1)
.Cells(I, 16) = I - 1
.Cells(I, 17) = SH.Range("L4") & SH.Range("H4") & SH.Range("G4")
.Close False
End With
Application.ScreenUpdating = True
Err.clear
On Error GoTo 0
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
.Cells(I, 12) = Int(FileLen(spath & sFileName) / 1024) & " kb"
.Cells(I, 13) = VBA.Right(Cells(I, 11), 3)
' Set f = fs.GetFile(spath & sFileName) '返回指定路径文件所对应的 File 对象
.Cells(I, 14) = f.DateCreated
.Cells(I, 15) = f.DateLastModified
'.Cells(i, 14) = FileDateTime(spath & sFileName)
Call 设置边框(I, 11, 15)
sFileName = Dir()
I = I + 1
'
|
-
|