小编Dha*_*dra的帖子

通过Excel VBA代码解压缩文件

团队,我正在努力从VBA代码中提取zip文件,但收到错误,这是我的代码

Sub Un_Zip_File()
Dim flname As String
Call PathCall
flname = Dir(impathn & "Transactions*.zip")
Call PathCall
Call UnZip_File(impathn, flname)
End Sub

Sub UnZip_File(strTargetPath As String, fname As Variant)
Dim oApp As Object, FSOobj As Object
Dim FileNameFolder As Variant

If Right(strTargetPath, 1) <> Application.PathSeparator Then
strTargetPath = strTargetPath & Application.PathSeparator
End If

FileNameFolder = strTargetPath

'destination folder if it does not exist
Set FSOobj = CreateObject("Scripting.FilesystemObject")
If FSOobj.FolderExists(FileNameFolder) = False Then
FSOobj.CreateFolder FileNameFolder
End If

Set oApp = CreateObject("Shell.Application")
oApp.Namespace(FileNameFolder).CopyHere …
Run Code Online (Sandbox Code Playgroud)

excel vba excel-vba

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

excel ×1

excel-vba ×1

vba ×1