码迷,mamicode.com
首页 > 其他好文 > 详细

用VB把xls转换为xlsx

时间:2016-08-01 11:54:03      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:

Sub xls批量转换成xlsx()
Application.ScreenUpdating = False
MsgBox "现在开始转换,请稍候!"
mypath = ThisWorkbook.Path & "\"
mybook = Dir(mypath & "*.xls")
Do While Len(mybook)
Set wb = Workbooks.Open(mypath & mybook)
wb.SaveAs mypath & mybook & "x", xlOpenXMLWorkbook
wb.Close
p = p + 1
Application.StatusBar = "已转换" & p & "个工作薄"
If p Mod 5 = 0 Then DoEvents
Loop
Application.StatusBar = ""
MsgBox "全部转换完成!共 " & p & " 个!"
End Sub

用VB把xls转换为xlsx

标签:

原文地址:http://www.cnblogs.com/mahocon/p/5724904.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!