Sub zipFile() Dim winrarPath$, fullname$, filename$, filePath winrarPath = "c:/program files/winrar/winrar.exe a -afzip " filePath = Application.GetOpenFilename If filePath <> False Then fullname = StrReverse(Split(StrReverse(filePath), "/")(0)) filename = Split(fullname, ".")(0) Shell winrarPath & filename & " " & fullname End If End Sub 注:此代码只能压缩单个文件。压缩多个文件的需要传入一个压缩后的文件名,代码也差不多,不难,大家想想也就出来了。 作者:laoyebin(Paladin.lao) 博客园出处: http://laoyebin.cnblogs.com/ 个人网站英文出处: http://mrvsto.com/ 个人网站中文出处: http://cn.mrvsto.com/